XMLHttpRequest

  • Revision slug: Talk:Document_Object_Model_(DOM)/XMLHttpRequest
  • Revision title: XMLHttpRequest
  • Revision id: 163602
  • Created:
  • Creator: Riboribo
  • Is current revision? No
  • Comment

Revision Content

Requests to 'other' hosts/ports

The examples show sending requests to specific hosts (ie http://mozilla.org/etc/etc) however, from the browser (javascript) you can't direct requests to any host or port on that host other than the one the page came from. That's true, isn't it? If so was should document that. Why is this restriction needed? You can pass info cross-domain through things like <img src=...> can't do? --User:riborib 24 Jul 08


USer:Pmash Is there going to be a list of all the methods and properties of this object on the wiki, so we can link to it in articles etc ?

Probably yes, but we need to figure the way it should be done. Perhaps the documentation or some parts of it should be autogenerated from relevant IDLs. I think it's an interesting question to bring up on the mailing list. --Nickolay 12:49, 23 April 2006 (PDT)

xmlHttpRequests can hang FireFox

The number of simultaneous xmlHttpRequest (XHR) extant at one time is controlled limited by the about:config preference: network.http.max-persistent-connections-per-server (which is 2 by default). An additional XHR can cause FireFox to hang (windows don't repaint, UI buttons frozen) until one of the XHRs complete.

A long running XHR can occur when a web page is waiting for notifications pushed from a server. Opening two or three such pages from the same server can cause the browser to hang when the browser attempts to load another page, image, script or CSS file.

I think that the limit of max-persistent-connections-per-server should not apply to XHRs (which are under control of the web page creator); that they should be limited by a separate count from connections created by the browser while loading elements of a page; or, at least, should not cause the browser display painting the UI function to hang.

--riboribo 24 Oct O7

nsIJSXMLHttpRequest

I think progress monitoring stuff should be described on this page as well. nsI* interfaces are of no interest to web develoepers. --Nickolay 18:24, 10 October 2006 (PDT)

Good point. I'll work on that. What I'll do is place a code sample or two on the XMLHttpRequest page. --Sheppy 19:43, 10 October 2006 (PDT)

This page is in serious need of updating. There needs to be full documentation on the makeup of the XMLHttpRequest object. --Nightstrike 15:13, 24 April 2007 (PDT)

responseXML after parse errors

I've noticed that if the XML document received from the server is not well formed then the responseXML parameter contains an xml document describing the error. It is not set to null (FF 2.0). Use responseXML.getElementsByTagName('parsererror') to see if this is the case. Also of note is that Opera has an empty XML document if there is a parse error. --Qazzian 04:12, 12 January 2007 (PST)

"status" property crash

Be aware of this bug : https://bugzilla.mozilla.org/show_bug.cgi?id=301705 It is happening when a query is done from a popup window and when this popup window is closed before the end of the request. I've tried creating the XmlHttpRequest object from the main opener window (new theMainWindow.xmlHttpRequest()), it's the same.

Page needs a do-over

This article needs to be redone as a proper reference document with complete coverage of all methods and properties, instead of being mostly examples. --Sheppy 14:19, 1 October 2007 (PDT)

Page needs additions

Actually, I find examples to be very helpful because it makes things less dry and easier to understand. Examples are often lacking in formal reference documentation. Perhaps adding the usage and keeping the examples may prove to be the most helpful.

I do think some of the examples may be incorrect, so having someone go through them would be extremely helpful. The synchronous AJAX request example has async set to true, which actually makes the request asynchronous. However, in Firefox 3 Beta 5, the synchronous AJAX requests appear to be non-blocking, implying that the async flag serves no purpose. Again, this is another supporting argument for adding reference documentation but not necessarily arguing that exmaples should be removed, just corrected. Jmort253 15:08, 4 May 2008 (PDT)

Revision Source

<h3 name="Requests_to_.27other.27_hosts.2Fports">Requests to 'other' hosts/ports</h3>
<p>The examples show sending requests to specific hosts (ie http://mozilla.org/etc/etc)  however, from the browser (javascript) you can't direct requests to any host or port on that host other than the one the page came from.  That's true, isn't it?  If so was should document that.  Why is this restriction needed?  You can pass info cross-domain through things like &lt;img src=...&gt; can't do?
--<a href="User:Riborib">User:riborib</a> 24 Jul 08
</p><p><br>
<a href="User:Pmash">USer:Pmash</a>
Is there going to be a list of all the methods and properties of this object on the wiki, so we can link to it in articles etc ?
</p>
<dl><dd> Probably yes, but we need to figure the way it should be done. Perhaps the documentation or some parts of it should be autogenerated from relevant IDLs. I think it's an interesting question to bring up on the mailing list. --<a href="User:Nickolay">Nickolay</a> 12:49, 23 April 2006 (PDT)
</dd></dl>
<h3 name="xmlHttpRequests_can_hang_FireFox"> xmlHttpRequests can hang FireFox </h3>
<p>The number of simultaneous xmlHttpRequest (XHR) extant at one time is controlled limited by the about:config preference: network.http.max-persistent-connections-per-server (which is 2 by default).       
An additional XHR can cause FireFox to hang (windows don't repaint, UI buttons frozen) until one of the XHRs complete.
</p><p>A long running XHR can occur when a web page is waiting for notifications pushed from a server.  Opening two or three such pages from the same server can cause the browser to hang when the browser attempts to load another page, image, script or CSS file.
</p><p>I think that the limit of max-persistent-connections-per-server should not apply to XHRs (which are under control of the web page creator); that they should be limited by a separate count from connections created by the browser while loading elements of a page; or, at least, should not cause the browser display painting the UI function to hang. 
</p><p>--<a href="User:Riboribo">riboribo</a> 24 Oct O7
</p>
<h3 name="nsIJSXMLHttpRequest"> nsIJSXMLHttpRequest </h3>
<p>I think progress monitoring stuff should be described on this page as well. nsI* interfaces are of no interest to web develoepers. --<a href="User:Nickolay">Nickolay</a> 18:24, 10 October 2006 (PDT)
</p><p>Good point.  I'll work on that.  What I'll do is place a code sample or two on the XMLHttpRequest page. --<a href="User:Sheppy">Sheppy</a> 19:43, 10 October 2006 (PDT)
</p><p>This page is in serious need of updating.  There needs to be full documentation on the makeup of the XMLHttpRequest object. --<a href="User:Nightstrike">Nightstrike</a> 15:13, 24 April 2007 (PDT)
</p>
<h3 name="responseXML_after_parse_errors"> responseXML after parse errors </h3>
<p>I've noticed that if the XML document received from the server is not well formed then the responseXML parameter contains an xml document describing the error. It is not set to null (FF 2.0). Use responseXML.getElementsByTagName('parsererror') to see if this is the case. Also of note is that Opera has an empty XML document if there is a parse error. --<a href="User:Qazzian">Qazzian</a> 04:12, 12 January 2007 (PST)
</p>
<h3 name=".22status.22_property_crash"> "status" property crash </h3>
<p>Be aware of this bug : https://bugzilla.mozilla.org/show_bug.cgi?id=301705
It is happening when a query is done from a popup window and when this popup window is closed before the end of the request. I've tried creating the XmlHttpRequest object from the main opener window (new theMainWindow.xmlHttpRequest()), it's the same.
</p>
<h3 name="Page_needs_a_do-over"> Page needs a do-over </h3>
<p>This article needs to be redone as a proper reference document with complete coverage of all methods and properties, instead of being mostly examples. --<a href="User:Sheppy">Sheppy</a> 14:19, 1 October 2007 (PDT)
</p>
<h3 name="Page_needs_additions"> Page needs additions </h3>
<p>Actually, I find examples to be very helpful because it makes things less dry and easier to understand.  Examples are  often lacking in formal reference documentation.  Perhaps adding the usage and keeping the examples may prove to be the most helpful.
</p><p>I do think some of the examples may be incorrect, so having someone go through them would be extremely helpful.  The synchronous AJAX request example has async set to true, which actually makes the request asynchronous.  However, in Firefox 3 Beta 5, the synchronous AJAX requests appear to be non-blocking, implying that the async flag serves no purpose.  Again, this is another supporting argument for adding reference documentation but not necessarily arguing that exmaples should be removed, just corrected.  <a href="User:Jmort253">Jmort253</a> 15:08, 4 May 2008 (PDT)
</p>
Revert to this revision