W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2012

Re: [XHR] Need to define the behavior when the Window the XHR is created from does not have an associated document

From: Anne van Kesteren <annevk@annevk.nl>
Date: Fri, 14 Dec 2012 19:55:54 +0100
Message-ID: <CADnb78jq14yhvr2E9BPYO4Ks+pkwz0O6nprsHOiHJahUJbZpCw@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>, Ian Hickson <ian@hixie.ch>
Cc: Jungkee Song <jungkee.song@samsung.com>, public-webapps@w3.org
On Fri, Dec 14, 2012 at 7:31 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> Though the real question is whether this:
>   <script>
>     window.onload = function() {
>       document.open();
>       var xhr = new XMLHttpRequest();
>       xhr.open("GET", "");
>       xhr.send();
>     }
>   </script>
> should really throw or not...  It's a slightly weird case where the Window
> the code is running in is no longer the currently active Window but the page
> is sort of still around, kinda.

It seems to depend on whether or not the old Window object still has
an associated document. If it still points to the active document the
above "would work". If it points nowhere the above cannot work and
we'd have to throw somewhere (constructor seems fine to me if that's

Ian, ideas?

Received on Friday, 14 December 2012 18:56:22 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:50 UTC