[HTML_AJAX-devel] AJAX Error 0x80040111 (NS_ERROR_NOT_AVAILABLE)
Joshua Eichorn
josh at bluga.net
Wed Feb 20 09:28:15 MST 2008
Your not in the correct state to read that variable.
Check out http://svn.bluga.net/HTML_AJAX/trunk/js/HttpClient.js for an
example on how it should be done.
_readyStateChangeCallback is the method that checks the status
-josh
kamo wrote:
>
> Hi!
>
> > I'm having some problems to debug some AJAX oriented code that follows:
>
>
> function sendAjaxRequest(formIndex, outputElement, flagElement){
>
> var Form = document.forms[formIndex];
> var requestString = getRequestString(Form);
> var XMLHttp = makeXMLHttpObject();
>
> // Output the status element
> build_loading_flag(flagElement);
>
> XMLHttp.open("post", Form.action, true);
> XMLHttp.setRequestHeader("Content-Type",
> "application/x-www-form-urlencoded; charset=UTF-8");
>
> XMLHttp.onreadystatechange =
> function (){
> if(XMLHttp.readyState == 4){
> // This is resultant response form the server
> showResults(XMLHttp.responseText, outputElement);
> destroy_loading_flag(flagElement);
> // Resets the form content
> //document.forms[formIndex].reset();
> }
> else{
> if (XMLHttp.statusText != "OK"){
> alert("An error has occurred. Status: " + XMLHttp.statusText);
> destroy_loading_flag(flagElement);
> }
> else {
> destroy_loading_flag(flagElement);
> }
> }
> };
> // This would be set to null in case of a GET request
> XMLHttp.send(requestString);
> }
>
> Every time I invoke this function Firefox error console throws the
> following message at the line that calls the statusText attribute:
>
> [Exception... "Component returned failure code: 0x80040111
> (NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.statusText]" nsresult:
> "0x80040111 (NS_ERROR_NOT_AVAILABLE)"
>
> Can someone help me out on this one. I'm not proefficient in this matters.
> -- Thanks in advance.
>
>
>
>
More information about the Html_ajax-devel
mailing list