views:

38

answers:

2

What my understanding is that functions in an iframe are "independent" on the parent window. So I think if there is an infinite loop in the script of the frame, the parent window should not be interfered. I implemented a program to test it, but found the infinite loop blocks the parent window's functions. Is the program or my understanding wrong?

+2  A: 

The parent doc is independent of the iframe in the time of rendering. But if there is an infinite loop in the iframe document/page, the browser might have been busy running that code and not getting time to do anything else. See whether you are overwhelming the browser.

Kangkan
Is there anyway that I can keep sending requests, like an infinite loop, to a window?
Paul
You should never use an infinite loop. Rather you can use a timeout function to call the method on a regular basis. The timeout value should be a decent one not to overwhelm the browser.
Kangkan
A: 

Good Browsers recognize infinite loops, so throw away your Internet Explorer and get a browser and you'll never again get such problems.

levu
Even in browsers that recognize infinite loops, they're not desirable. Not to mention that it's basically a timer, not actual infinite loop detection.
George Marian