crazyinsomniac has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

Is there a way( i suspect not) to retrieve information,
such as 'real-time' stock quotes or headlines or something,
and stick it in a form-field, without reloading the browser?

  • Comment on Retrieving Dyn-Data from CGI without reloading web-page?

Replies are listed 'Best First'.
RE: Retrieving Dyn-Data from CGI without reloading web-page?
by t0mas (Priest) on Jul 11, 2000 at 13:20 UTC
    Maybe this is to swear in church, but a java applet will do this for you.
    Another method is to use a hidden frame (1 pixel high or so at the bottom) that you reload using javascript, then parse with javascript onLoad and put the contents of it in a regular form in another (large) frame.
    This makes the reloading almost invicible to the user.

    /brother t0mas
Re: Retrieving Dyn-Data from CGI without reloading web-page?
by Anonymous Monk on Jul 11, 2000 at 16:06 UTC
    Short answer: CGI::Push

    Long answer: get the proceedings from yapc19100 and read "A Dynamic Data-display System Using CGI and Server Push"
      I guess the above answer is technically correct, although I would never use Server Push technologies. From the small experiments that I have run with Push (about a year ago), I noticed that while the server-side works well under Apache, MS browsers tend to hang if you leave them running on push for over long periods of time/data.

      On the server-side, my first try was with ActiveState and IIS 4.0. Needless to say that for every open connection another perl process spawned and soon enough the machine was brought down to its knees. I guess it was probably something that I was doing wrong, but I managed to improove this greatly by moving everything to a Linux server running everything under Apache.

      IMHO, too many small glitches to actually do anything serious.

      I fooled around a bit with Active Channels (remember that screensaver thingy that came with IE 4.0?) trying to build a newscast for my intranet with perl. It didn't work out as I had expected. I'll try and find the code I was working on (if I still have it on tape).

      #!/home/bbq/bin/perl
      # Trust no1!
        The system described in the paper has been running in a government aerospace lab (wind tunnel actually) for over a year. Netscape clients on NT and SGI, Apache server on SGI.
      Hi,

      Where can i find that article?
      Is it an article, or a book?

      "A Dynamic Data-display System Using CGI and Server Push"

       ______________________________________________
      |_____¸.·ooO--(> cRaZy is co01. <)--Ooo·.¸_____|
       ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
      
        here
        Just ignore the cheezy banner ads.
Re: Retrieving Dyn-Data from CGI without reloading web-page? (javascript?)
by ybiC (Prior) on Jul 11, 2000 at 13:11 UTC
    someone said as much in the Chatterbox - this sounds like a job for JavaScript. Are there other methods I'm unaware of?

      It was me talking in the Chatterbox. I don't think that JavaScript will do it as I don't know how you'd get the new data from the server.

      As I see it there are three options:

      1. Java applet
      2. CGI script with a refresh HTTP header (but this reloads the whole page which crazyinsomniac doesn't want)
      3. You might be able to use a non-parsed header script - but I don't know enough about them to comment.
      --
      <http://www.dave.org.uk>

      European Perl Conference - Sept 22/24 2000, ICA, London
      <http://www.yapc.org/Europe/>