Im just writing a small Ajax framework for re-usability in small projects and i\'ve hit a problem. Basically i get a \'NS_ERROR_ILLEGAL_VALUE
\' error while send
This error message is one of the 'quirks' of FireFox's XMLHttpRequest object. The same issue in IE will have different symptoms.
You don't want to deal with all these quirks yourself now that there's lots of good libraries out there.
For instance in Netscape and FX calling XMLHttpRequestObject.responseText
or XMLHttpRequestObject.status
throws an "NS_..." error for any connection problems. IE will returns the OS network error code instead - no error thrown. If you handle this yourself you will have to build in the error handling for both.
I would recommend jQuery. Prototype is also excellent.
The exception "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE)" is caused by an illegal value being passed into the call of open method.
Looking through your code I found misspelling:
this.RequestedMethod = p_RequestMethod; this.DestinationURL = p_DestinationURL; this.XMLHttpRequestObject.open(this.RequestMethod, this.DestinationURL);
See this.RequestedMethod property set to p_RequestMethod and this.RequestMethod being passed into the call of "open" method.
Also, instead of creating your own wrapper, I would recommend using open-source XMLHttpRequest.js - Standard-compliant cross-browser XMLHttpRequest object implementation, that also fixes some 20 bugs of browser's native XMLHttpRequest object implementations.