CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2007
    Posts
    3

    Comet - can't get rid of browser loading bars

    I have a standard page implementing the Comet concept which contains a hidden iframe with src set to a Perl event listener script. The script listens for events dispatched by a custom event server and relays these events in script tags. This setup eliminates the need to poll the server with AJAX and query the database for changes, and it also provides instant publishing of every event to all listeners.

    The setup works as expected in Opera, Firefox, and IE, although Opera and Firefox perpetually display the "progess" cursor and the content loading bar. Other Comet implementations that I have seen do not trigger the loading bar.

    Perhaps I am misunderstanding or incorrectly implementing Comet. Does anyone know how the setup could be modified such that the loading bar is not triggered? The other aspect of this problem is that pressing the Stop button or Esc key terminates the connection.

    I have also tried a persistent XMLHTTPRequest in Firefox and Opera. This effectively eliminates the loading bar problem, but instead a memory leak appears in Firefox even when no content is returned.

    The page itself is printed by a mod_perl2 script on an Apache 2.0 server. The page itself starts with the html and body tags as well as the text/html content-type header with no content-length.

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: Comet - can't get rid of browser loading bars

    When using a hidden iframe, depending on the browser, you will have the loading cursor. The only way to avoid this is using pure AJAX.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3
    Join Date
    Jul 2007
    Posts
    3

    Re: Comet - can't get rid of browser loading bars

    That's what I was afraid of. It is easy enough to change the cursor to "pointer" or "crosshairs" or something ridiculous with CSS, but "default" unfortunately does not override the current cursor with the default (arrow) cursor.

    I think the link below is the closest example that I will get to what I want to do. They do some fancy ActiveX magic to create a fake page for holding the iframe in IE and FF/Opera use the XMLHTTPRequest object. Firefox closes the connection when Esc is pressed, but with the request object it is easy enough to check for a readystatechange. Opera works fine.

    http://empireenterprises.com/_comet.html#server_example

    Unfortunately I will still have to fall back to polling for Safari, Konqueror, etc.

  4. #4
    Join Date
    May 2010
    Posts
    1

    Re: Comet - can't get rid of browser loading bars

    This post explains the solutions that maybe used in firefox and IE, check it out @
    http://www.shanison.com/?p=237

  5. #5
    Join Date
    May 2002
    Posts
    10,943

    Re: Comet - can't get rid of browser loading bars

    Welcome to the forums, Shanison. Please remember to keep your posts relevant. This thread is 3 years old!
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured