[OpenLayers-Trac] [OpenLayers] #3347: XMLHttpRequest send without
open throws exception.
OpenLayers
trac-20090302 at openlayers.org
Mon Jun 6 16:35:54 EDT 2011
#3347: XMLHttpRequest send without open throws exception.
---------------------+------------------------------------------------------
Reporter: dzwarg | Owner: tschaub
Type: bug | Status: new
Priority: minor | Milestone: 2.10 Release
Component: Request | Version: 2.10
Keywords: | State:
---------------------+------------------------------------------------------
If an XMLHttpRequest is created, and the send() method is invoked without
first calling open(), an exception is thrown. While this doesn't cause any
errors, since it appears as though the XMLHttpRequest does call this code
again after opening the connection, it does cause headaches in IE, where a
dialog appears asking if the user would like to debug the script. That's
annoying.
In IE, the exception thrown is an "Unspecified Error."
In FF, the exception thrown is an "Component returned failure code:
0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIXMLHttpRequest.send]"
While my usual debugging approach would be tell a user "Don't DO that," I
thought it would be helpful to pitch this back to the library when we
started seeing strategy load() calls throwing this exception. It was
terribly difficult to track where the strategy was performing this
sequence, but extremely easy to reproduce in XMLHttpRequest.
Attached is a test and bugfix patch against 2.10 release. I checked trunk,
but this code is heavily changed in trunk. In case anyone else needs this
patch, enjoy.
--
Ticket URL: <http://trac.openlayers.org/ticket/3347>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer
More information about the Trac
mailing list