Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #13114

Re: Safari XHR Error

Date 2012-03-29 10:04 -0500
From MC <news@aisus.com>
Newsgroups comp.lang.javascript
Subject Re: Safari XHR Error
References <4bd1f$4f7476a3$cf9b42fc$12752@ALLTEL.NET> <timstreater-C7852C.15452629032012@news.individual.net>
Message-ID <40869$4f747a75$cf9b42fc$8075@ALLTEL.NET> (permalink)
Organization UseNetServer.com

Show all headers | View raw


On 3/29/2012 9:45 AM, Tim Streater wrote:
> In article <4bd1f$4f7476a3$cf9b42fc$12752@ALLTEL.NET>,
> MC <news@aisus.com> wrote:
>
>> Newslist Folks,
>>
>> The code below works for IE9, Chrome, Firefox but fails on Safari 5 on
>> Windows.
>>
>> Line1: var action = (the specific webservice ie, /ws/WSAPI199B.jsp)
>> Line2: var myXHR = (function to get browser compliant XHR)
>> Line3: myXHR.open("POST","/ws/"+action+".jsp");
>> Line4: myXHR.onreadystatechange=AISUS.APPLICATION.handleResponse;
>>
>> Line2 gets a valid XHR object. Inspecting using the Safari debugger
>> shows that Line3 seems to 'null' the XHR object. Line4 gets the
>> following error:
>> INVALID_STATE_ERR: DOM Exception 11: An attempt was made to use an
>> object that is not, or is no longer, usable.
>
> Any particular reason you're not waiting for the right status (200) and
> readyState (4) ?
>
> Precisely which version of Safari?
>

Tim,

This is Safari 5.1.4 on Win7-64. The handleResponse method waits for 
readyState(4), but never gets called. The problem here is the XHR.open 
method seems to invalidate the object, at least thats what the debugger 
is saying.

FYI, Line5: is myXHR.send(myRequest); which gets the same error as Line3.

MC

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Safari XHR Error MC <news@aisus.com> - 2012-03-29 09:37 -0500
  Re: Safari XHR Error Tim Streater <timstreater@greenbee.net> - 2012-03-29 15:45 +0100
    Re: Safari XHR Error MC <news@aisus.com> - 2012-03-29 10:04 -0500
  Re: Safari XHR Error Gregor Kofler <usenet@gregorkofler.com> - 2012-03-29 17:22 +0200
  Re: Safari XHR Error MC <news@aisus.com> - 2012-03-29 12:05 -0500
    Re: Safari XHR Error Gregor Kofler <usenet@gregorkofler.com> - 2012-03-29 20:26 +0200
      Re: Safari XHR Error MC <news@aisus.com> - 2012-03-29 14:26 -0500
        Re: Safari XHR Error Gregor Kofler <usenet@gregorkofler.com> - 2012-03-29 21:54 +0200
          Re: Safari XHR Error MC <news@aisus.com> - 2012-03-29 15:24 -0500
    Re: Safari XHR Error Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2012-03-29 22:28 +0200
      Re: Safari XHR Error David Mark <dmark.cinsoft@gmail.com> - 2012-03-29 18:06 -0700
  Re: Safari XHR Error "Richard Cornford" <Richard@litotes.demon.co.uk> - 2012-03-29 21:39 +0100
    Re: Safari XHR Error MC <news@aisus.com> - 2012-03-29 16:07 -0500
      Re: Safari XHR Error Scott Johnson <noonehome@chalupasworld.com> - 2012-03-29 17:30 -0700
      Re: Safari XHR Error "Richard Cornford" <Richard@litotes.demon.co.uk> - 2012-03-30 01:46 +0100
      Re: Safari XHR Error David Mark <dmark.cinsoft@gmail.com> - 2012-03-29 14:54 -0700

csiph-web