XMLHttpRequest datacollision

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dafke

    XMLHttpRequest datacollision

    Hi, I'm working on a live chat with a XMLHttpRequeste ngine.
    The script is working fine except for one thing. Although I use the
    asynchronous mode, the script seems to have a little refractionairy
    period.
    I have three XMLhttpRequest objects loaded, one for checking for new
    text and one to check for new users. And the last one is made when the
    user wants to send a message.
    Most of the hime everything works fine, however sometimes the user who
    sends text doesn't receive this text back. The other users do see the
    text. Has anyone some experience with it?

    The chat is running on http://www.fiaminga.com/login.html. ( still not
    fully operational and no lay-out applied). Just see the sourcecode as
    usual.

    Thanx,

  • Martin Honnen

    #2
    Re: XMLHttpRequest datacollision



    dafke wrote:
    [color=blue]
    > Hi, I'm working on a live chat with a XMLHttpRequeste ngine.
    > The script is working fine except for one thing. Although I use the
    > asynchronous mode, the script seems to have a little refractionairy
    > period.
    > I have three XMLhttpRequest objects loaded, one for checking for new
    > text and one to check for new users. And the last one is made when the
    > user wants to send a message.
    > Most of the hime everything works fine, however sometimes the user who
    > sends text doesn't receive this text back. The other users do see the
    > text. Has anyone some experience with it?[/color]

    Does that happen with one particular browser supporting XMLHttpRequest
    or does it happen with several ones?


    --

    Martin Honnen

    Comment

    • dafke

      #3
      Re: XMLHttpRequest datacollision

      It happens aswel with IE as with Mozilla, however Mozilla seems to give
      more problems then IE.

      this is the snippet on the activition of the (activeX)object s
      function httpObject()
      {
      var xmlhttp
      try {
      xmlhttp = new ActiveXObject(" Msxml2.XMLHTTP" );
      }
      catch(e)
      {
      try {
      xmlhttp = new ActiveXObject(" Microsoft.XMLHT TP");
      }
      catch(e)
      {
      try
      {
      xmlhttp = new XMLHttpRequest( );
      }
      catch(e)
      {
      alert('no object made');
      xmlhttp = false;
      }
      }
      }
      return xmlhttp;
      }
      var http = httpObject();

      Comment

      • phil_gg04@treefic.com

        #4
        Re: XMLHttpRequest datacollision

        > I'm working on a live chat with a XMLHttpRequeste ngine.

        I can thoroughly recommend the Sarissa library for this sort of thing.
        It hides all the platform differences perfectly. It's on sourceforge.
        [color=blue]
        > I have three XMLhttpRequest objects loaded, one for checking for new
        > text and one to check for new users. And the last one is made when[/color]
        the[color=blue]
        > user wants to send a message.[/color]

        You might like to have a look at Anyterm, which has to solve a similar
        problem.

        --Phil.

        Comment

        Working...