AJAX Chat room... heh... What are these exceptions?

Discussion in 'JavaScript' started by drewbe121212, Sep 9, 2006.

  1. #1
    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 9, 2006 IP
  2. drewbe121212

    drewbe121212 Well-Known Member

    Messages:
    733
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    125
    #2
    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.
     
    drewbe121212, Sep 10, 2006 IP
  3. VONRAT

    VONRAT Banned

    Messages:
    181
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    duhh ... that seems to be a workaround instead of a fix .. hehe thanks i got an idea from your post
     
    VONRAT, Sep 11, 2006 IP
  4. drewbe121212

    drewbe121212 Well-Known Member

    Messages:
    733
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    125
    #4
    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 :/
     
    drewbe121212, Sep 11, 2006 IP