W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2008

[whatwg] Scripts not in the active document

From: Mike Wilson <mikewse@hotmail.com>
Date: Wed, 14 May 2008 11:42:51 +0200
Message-ID: <BAY116-DAV234F877657E47DF6BC816A4CE0@phx.gbl>
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

Best regards
Mike Wilson
Received on Wednesday, 14 May 2008 02:42:51 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:02 UTC