javaScript local script can't find function in src script -


i have javascript source file, named limdu.js, contains var , function, --

var sessiontimeoutid;  function keepsessionalive() { var sessiontimeoutwarning = @session.timeout; var stimeout = parseint(sessiontimeoutwarning) * 60 * 1000;  cleartimeout(sessiontimeoutid); sessiontimeoutid = settimeout('sessionend()', stimeout);  function sessionend() {     window.location = "/account/logoff"; }  } 

and in cshtml file, have this:

<script type="text/javascript" src="~/scripts/limdu.js"></script> <script> $(document).ready(function () {        keepsessionalive();     }); </script> 

but when try execute code, error "keepsessionalive" not found.

i thought src code loaded before local script code executed; if that's not case, how refer function in local script block that's defined in src'd file?

check console. limdu.js file not compiling (probably undefined @session ?)


Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -