specification about the HTML/DOM/Javascript page life cycle to provea bug occured

I

i4587415

Hi all,

Question:
Where can I find a documentation or specification about the HTML/DOM/
Javascript page life cycle to prove that:
when a page is redirected to another page using document.location =
nextUrl; all the function execution should be stopped in the original
page? Otherwise, it should be a bug in the browser.

Background:
Browser is Internet Explorer 6, in Windows XP SP2.

At first page, I have a timer count down using setItnterval from 30
seconds. But when the page is redirected to next page, these functions
as I understood should be stopped. But it looks like the setInterval()
is still running. When the count down is 0 (I used a stop watch to
continue keep track of the time) at second page, there is script error
occurs,
"Wrong number of arguments or invalid property assignment"

Illustration:
[Page1] setInterval() to count down time from 30 seconds
==>
[Page1] before reaching 0 seconds, call document.location = Page2;
==>
[Page2] now at Page2
==>
[Page2] time reached zero second as monitored from stop watch
==>
[Page2] script error occured, "Wrong number of arguments or invalid
property assignment"


Thank you.

Best regards,
John.
 
R

RobG

Hi all,

Question:
Where can I find a documentation or specification about the HTML/DOM/
Javascript page life cycle to prove that:
when a page is redirected to another page using document.location =
nextUrl;  all the function execution should be stopped in the original
page? Otherwise, it should be a bug in the browser.

Background:
Browser is Internet Explorer 6, in Windows XP SP2.

At first page, I have a timer count down using setItnterval from 30
seconds. But when the page is redirected to next page, these functions
as I understood should be stopped. But it looks like the setInterval()
is still running. When the count down is 0 (I used a stop watch to
continue keep track of the time) at second page, there is script error
occurs,
"Wrong number of arguments or invalid property assignment"

OK, here's my test script run in IE 6 on XP SP 3:

window.onload = function() {
setTimeout(function(){alert(document.getElementById('foo').id)},
5000);
document.location = "http://www.google.com/";
};


No error is reported.
 
I

i4587415

Hi RobG,

Thanks for reply. I also tried a simple test page but cannot simulate
the error. It only occurs at our application page. It seems only
specific circumstance will trigger the "bug".

The point is that as I believe:
When Page-1 is redirected to Page-2, then whatever javascript
functions or loop executions in Page-1 should be stopped. But I cannot
find in the web any documentation show this.

Does anyone know of documentation or specification about this?


Thank you.

Regards,
John.
 
L

Lasse Reichstein Nielsen

The point is that as I believe:
When Page-1 is redirected to Page-2, then whatever javascript
functions or loop executions in Page-1 should be stopped. But I cannot
find in the web any documentation show this.

Does anyone know of documentation or specification about this?

The setTimeout/setInterval functions are not formally specified,
and tricky edge cases like this probably never will be.
That means that browser vendors do either what they have always
done, or what someone else is doing.
That includes running code after the page has been changed.

The delayed code will indeed be executed in some cases, but if the
page has been changed, then cross-site security might make some of the
actions it tries impossible. I'm guessing that's what's happening to
you.

/L
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top