AJAX - http.send(null)

A

afrinspray

I get this error everytime I finish an AJAX post with http.send(null):

Error: uncaught exception: [Exception... "Component returned failure
code: 0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.send]"
nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: [file
name here] :: getReplyWindow :: line 62" data: no]

Is it necessary to follow up the final http.send with http.send(null)?

Thanks,
Mike
 
R

Rob Mitchell

(e-mail address removed) wrote in @u72g2000cwu.googlegroups.com:
I get this error everytime I finish an AJAX post with http.send(null):

Error: uncaught exception: [Exception... "Component returned failure
code: 0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.send]"
nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: [file
name here] :: getReplyWindow :: line 62" data: no]

Is it necessary to follow up the final http.send with http.send(null)?

Thanks,
Mike

try this instead:

http.send("");
 
A

afrinspray

Nope I still get it. When I send http.send(null) on a get, everything
works fine- just not when posting after sending the post parameters.
Are you only allowed to do one http.send() command per state change? I
mean, there's these:
0: Uninitialized
1: Loading
2: Loaded
3: Interactive
4: Finished

After the first send, it just goes into state 4, huh?
 
T

Thomas 'PointedEars' Lahn

I get this error everytime I finish an AJAX post with http.send(null):

Error: uncaught exception: [Exception... "Component returned failure
code: 0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.send]"
nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: [file
name here] :: getReplyWindow :: line 62" data: no]

Is it necessary to follow up the final http.send with http.send(null)?

You are not making any sense. XMLHTTPRequest::send() can only be called
once-in-a-row reliably.


PointedEars
 
T

Thomas 'PointedEars' Lahn

Rob said:
I get this error everytime I finish an AJAX post with http.send(null):

Error: uncaught exception: [Exception... "Component returned failure
code: 0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.send]"
nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: [file
name here] :: getReplyWindow :: line 62" data: no]
[...]

try this instead:

http.send("");

The meaning of this is entirely different than passing `null',
and it does not have anything to do with the exception:

<URL:http://lxr.mozilla.org/mozilla1.8.0/source/extensions/xmlextras/base/src/nsXMLHttpRequest.cpp#1423>

Please get informed before you try to provide any advice.


PointedEars
 
A

afrinspray

Dear Thomas 'PointedEars',

I was asking why send can't be called more than once...

Also, Rob was just trying to help. Stop breeding negativity on the
newsgroups.

Thanks,
Mike
 
A

afrinspray

Nope I'm still here.

Pointy said:
And /I/ provided that answer. [earlier he said]
You are not making any sense. XMLHTTPRequest::send() can only be called
once-in-a-row reliably.

Is hardly an answer... how does that explain why?
 
T

Thomas 'PointedEars' Lahn

afrinspray said:
Nope I'm still here.

Pointy Ears wrote:

My nickname is "PointedEars", afrospray.
And /I/ provided that answer. [earlier he said]
You are not making any sense. XMLHTTPRequest::send()
can only be called once-in-a-row reliably.

Is hardly an answer... how does that explain why?

Follow the link.


PointedEars
 
A

afrinspray

Alright after wasting a half hour of my life I finally understand the
send method of xmlhttprequest. God bless you PointedEars.

BTW nice nickname! Must suck being a vampire. Also I might just have
to change my name to afrospray.
 
T

Thomas 'PointedEars' Lahn

afrinspray said:
Alright after wasting a half hour of my life I finally understand the
send method of xmlhttprequest.

You needed _half an hour_(!) to understand the connection between

| Error: uncaught exception: [Exception... "Component returned failure
| code: 0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.send]"
^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
| nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: [file
^^^^^^^^^^^^^^^^
| name here] :: getReplyWindow :: line 62" data: no]

<http://lxr.mozilla.org/mozilla1.8.0/source/extensions/xmlextras/base/src/nsXMLHttpRequest.cpp#1423>
(see
-------- /extensions/xmlextras/base/src/nsXMLHttpRequest.cpp ----------
[...]
1423 nsXMLHttpRequest::Send(nsIVariant *aBody)
^^^^^^^^^^^^^^^^ ^^^^
1424 {
1425 nsresult rv;
1426
1427 // Return error if we're already processing a request
1428 if (XML_HTTP_REQUEST_SENT & mState) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1429 return NS_ERROR_FAILURE;
^^^^^^^^^^^^^^^^
1430 }

? What kind of a silly loser are you anyway?
God bless you PointedEars.

BTW nice nickname! Must suck being a vampire. Also I might just have
to change my name to afrospray.

FOAD. *PLONK*


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top