Ajax Talk - Asynchronous javascript and xml discussion board
 FAQ   Search    Usergroups      Register   Profile   Check your messages   Log in 
Signup now to enjoy a range of free membership advantages !!
Ajax Talk - Moderators Wanted
Uncaucht exception

 
Post new topic   Reply to topic    Ajaxtalk.com Forum Index -> PHP
View previous topic :: View next topic  
Author Message
Jaws
New one
New one


Joined: 01 Apr 2008
Posts: 2

PostPosted: Tue Apr 01, 2008 8:05 pm    Post subject: Uncaucht exception Reply with quote

Can anyone tell me what this error means?

Code:
uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.send]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: javascript: eval(__firebugTemp__); :: anonymous :: line 1" data: no]


I have a PHP script wich uses AJAX to update information on a gameserver every 3 seconds. And the script just seems to crash randomly, sometimes after 5 seconds, sometimes 2 minutes etc.

I get OR the error message above in firebug, or I get an Internal Server error 500code error from firebug.

Should I post some of my code?

Edit: I maybe found a solution to the problem, but don't know if this is a "good" solution.

my js code now:
Code:
function retrieve_data() {
   if (ajax) {
      try {
         ajax.open('get', 'retrieve.php');
         ajax.onreadystatechange = handle_check;
         ajax.send(null);
      }
      catch (error) {
         //alert(error);
            document.getElementById('main').innerHTML = "Problem Communicating with server!";
      }
   }
   else {
      alert('Some page functionality is unavailable');
   }
}

function handle_check() {
   if ((ajax.readyState == 4) && (ajax.status == 200)) {
      document.getElementById('main').innerHTML = ajax.responseText;
      setTimeout('retrieve_data()',2000);
   }
   else {
      xmlhttp.abort();
   }
}


So I builded a try .. catch block arround the function calling to catch the exception. Will this work for all browsers?
Back to top
View user's profile Send private message
Jaws
New one
New one


Joined: 01 Apr 2008
Posts: 2

PostPosted: Tue Apr 01, 2008 9:25 pm    Post subject: Reply with quote

Hmm Confused I now get this error in firebug:

Code:
xmlhttp is not defined
handle_check()retrieve.js (line 26)
retrieve_data()retrieve.js (line 8)
[Break on this error] xmlhttp.abort();


And the script again just stops running.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Ajaxtalk.com Forum Index -> PHP All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
 Advertisements
 XML & Copyright Notice 
    


Powered by phpBB © 2001, 2005 phpBB Group

What is according to Wikipedia: Ajax Web2.0 XML E4X


Link to our site:

  


del.icio.us digg spurl wists simpy newsvine blinklist furl blogmarks yahoo! myweb smarking ma.gnolia segnalo reddit fark technorati cosmos


Normal Bookmark


Partner Button Links:
Codecrunch.com: Webmaster Tutorials    One Ajax


Partner Text Links:
quomon | web20log | ajaxmatters | tableless | 456bereastreet | music charts | gift ideas | competitions | free xbox 360 | link trade ?


Credits:
it consultancy & project management lead generation zoekmachine optimalisatie steal these buttons seo expert