469,946 Members | 1,782 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,946 developers. It's quick & easy.

Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE)

I've got the same problem with firefox. My web app works correctly on IE, but in firefox catch an exception like this:

uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.send]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: file:///C:/Users/workspace/request.js :: sendRequest :: line 48" data: no]

Expand|Select|Wrap|Line Numbers
  1. # function sendRequest(url,params)
  2. #         {                      
  3. # var http = getXMLHttp();
  4. var response=null;   http.open("GET",url,false);                          http.onreadystatechange=function() {
  5. #               if (http.readyState==4) {
  6. #                        response = http.responseText;
  7. #                                       }
  8. #                                  };    
  9. # http.send();   
  10. # }
  11. #  
  12. #  
  13. # function getXMLHttp() {
  14. #              var xmlhttp = null;
  15. #                 if (window.ActiveXObject) {
  16. #                    if(navigator.userAgent.toLowerCase().indexOf("msie5")!=-1)                  {
  17. #              xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  18. #                     } else {
  19. #              xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  20. #                     }
  21. #                   }
  22. #            if(!xmlhttp&&typeof(XMLHttpRequest)!='undefined') {
  23. #                     xmlhttp = new XMLHttpRequest();
  24. #                   }
  25. #                   return xmlhttp;
  26. #                   }
  27.  
Someone can help me?
Thanks in advance
Ale
Oct 17 '10 #1
1 5253
acoder
16,027 Expert Mod 8TB
Since it's an synchronous request, there's no need for onreadystatechange because the browser will wait for a response before handing back to the script. So, response = http.responseText; can go after the send() call.
Oct 18 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Mukesh | last post: by
2 posts views Thread by =?Utf-8?B?TWFyaw==?= | last post: by
5 posts views Thread by iu2 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.