SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru glenngould's Avatar
    Join Date
    Nov 2005
    Posts
    661
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Shoutbox Freezes After Some Time

    Actually IE7 freezes partially with my new ajax shoutbox.

    I coded a very simple chat application using ajax. I used setTimeout to check new messages and to refresh if any.

    The problem is after some time IE7 still runs the looped function (I know it from a simple loop counter I've added to the page), but just not recieves any new messages and refuses to send a new message if I type one.

    Firefox deals allright with it. I've just tested to send a new message after about 170 loops in idle (I have a delay calculator and one loop is 7 seconds if nothing happens through that period of time).

    I'll test it further to get what is going on, but help appreciated if you have any ideas already.

  2. #2
    SitePoint Guru glenngould's Avatar
    Join Date
    Nov 2005
    Posts
    661
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Made few tests, I'm still not sure but it looks like my serverside script (the php script that returns the new messages to javascript function) stops responding after some refresh loops.

    Maybe I should check my server logs to detect whether the php file is called or not. (I doubt this is the reason, because firefox freezes a lot later than IE7. Keep in mind that both browsers still run the javascript code perfectly while they cannot recieve new messages from the serverside script.)

    Edit:

    Checked the server logs. Well it stops asking for the php file after some loops although the javascript function works ok.

  3. #3
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you using POST or GET?

    IE caches ajax GET operations - if you are using get and it's failing either use POST or append some random querystring parameter every time you send an ajax request.

  4. #4
    SitePoint Guru glenngould's Avatar
    Join Date
    Nov 2005
    Posts
    661
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm using POST method. I solved it though, by aborting the XMLHttpRequest when server is not responding:

    xmlHttp.onreadystatechange = function() { };
    xmlHttp.abort();
    xmlHttp = null;


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •