Find jobs - Self Improvement Articles Directory - Debt Consolidation - Wordpress Themes - Debt Consolidation

PDA

View Full Version : AJAX Chat room... heh... What are these exceptions?


drewbe121212
Sep 9th 2006, 11:43 am
Hello All! I got bored and am making an AJAX chatroom.

I set a window interval for every second to check for new messages on the server. My only one question is that every once in a while an exception is being thrown.

the exception message is:
Error: uncaught exception: [Exception... "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIXMLHttpRequest.send]" nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame :: http://www.agoradesk.com/includes/clientjavascript/chat.js :: getChatMessages :: line 81" data: no]

I can assume this is because something is timing out or data is not being retrieved or something along the lines. Does anyone else have a suggestion or a way to catch this exception?

drewbe121212
Sep 10th 2006, 12:03 am
nevermind, after extensive research (and a little bit of grey goose :D) I have read that this error is caused by a bug in firefox. In order to fix this, you must create all new XML requests that have the possibility of being requested over top of each other (ie one request fireing while another is still active) is to create a new request object locally inside of each individual function call. This now eleminates any exceptions that might be thrown.

VONRAT
Sep 11th 2006, 7:01 pm
duhh ... that seems to be a workaround instead of a fix .. hehe thanks i got an idea from your post

drewbe121212
Sep 11th 2006, 7:07 pm
It is actually a bug in firefox though. In the other browsers, abort and a new request will cancel out or overwrite the request. Firefox doesn't :/