Its happens often when you perform some async operations and when you put break point it works fine because it load required script otherwise it is not working properly.
var sessionTimeoutWarning = 1
var sessionTimeOut 1;
var timeOnPageLoad = new date();
setTimeout('SessionWarning()',parseInt(sessionTimeoutWarning) * 60 * 1000);
function SessionWarning()
{
var currentTime = new date();
var timeForExpiry = timeOnPageLoad.setMinutes(timeOnPageLoad.getMinutes() + parseInt(sessionTimeOut));
var = modpopup = $find('mymodalpopup');
if (Date.parse(currentTime) > timeForExpiry)
{
modpopup.show();
}
}
This javascript code only works when i put a point break on the function.
According to you code, I think you JavaScript code should also be executed without setting break point. You could try to write some message into the browser console in function “SessionWarning” to make sure if SessionWarning() could be called after a specified
number of milliseconds.
function SessionWarning() {
console.log("start");
//your code
console.log("end");
}
Best Regards,
Fei Han
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
51 Points
208 Posts
asp.net 2010 - javascript only works on point break
Apr 19, 2016 11:39 AM|amendoza29|LINK
Good Day Everyone
I have a javascript that runs when the page is load, the problem is it only works when you are putting a point break on the function.
does anyone encounter this and solve? sorry i'm just a beginner on this and in javascript.
Thanks.
Contributor
2195 Points
950 Posts
Re: asp.net 2010 - javascript only works on point break
Apr 19, 2016 11:46 AM|jimmy69|LINK
Hello amendoza29,
is it possible to have code for to try to understand what's happen's ?
tell us more about the version of jquery inside of your project
thanks
Contributor
2096 Points
1040 Posts
Re: asp.net 2010 - javascript only works on point break
Apr 19, 2016 11:53 AM|Khuram.Shahzad|LINK
Its happens often when you perform some async operations and when you put break point it works fine because it load required script otherwise it is not working properly.
like us defer to avoid async loading.
Member
51 Points
208 Posts
Re: asp.net 2010 - javascript only works on point break
Apr 20, 2016 12:52 AM|amendoza29|LINK
Hi Jimmy
Here's my code
This javascript code only works when i put a point break on the function.
All-Star
40565 Points
6233 Posts
Microsoft
Re: asp.net 2010 - javascript only works on point break
Apr 20, 2016 08:19 AM|Fei Han - MSFT|LINK
Hi amendoza29,
According to you code, I think you JavaScript code should also be executed without setting break point. You could try to write some message into the browser console in function “SessionWarning” to make sure if SessionWarning() could be called after a specified number of milliseconds.
Best Regards,
Fei Han