[whatwg] Scripts not in the active document

Mike Wilson mikewse at hotmail.com
Wed May 14 02:42:51 PDT 2008


Ian Hickson wrote:
> Jonas Sicking wrote:
> > Scripts can actually still run fine even if you navigate 
> > away from a page. But there are definitely weird things 
> > happening (such as global scope being different from 'window').
> 
> Could you elaborate on this? I'm not clear on how to define this.

This may be nothing new, but in DWR we have had to handle a few 
cases related to this, and browsers differ. The scenario is that 
the user is navigating away from a page that still is doing some 
kind of script-related request to the server:

Case 1: The page is doing a request to the server through a hidden 
        IFRAME that receives a page containing <script>. It differs
        whether the request will be allowed to complete and the 
        script be run. (and window environment may go away)

Case 2: The page is doing a request to the server through XHR. It
        differs whether onreadystatechange callback is triggered.
        [XHR may be out of scope here, I'm just mentioning it for
        completeness.]

Best regards
Mike Wilson




More information about the whatwg mailing list