Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

update content without refreshing

by kwtow (Novice)
on Jun 08, 2003 at 16:21 UTC ( [id://264117]=perlquestion: print w/replies, xml ) Need Help??

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

Hi dear all,

I had been looking at ways to update content of a web page without using any auto refreshing meta.

This had been done by these 2 web page but I m not too sure how they manage to do that: royalscore and activescores.

Does anyone know how this is done and how we do this in perl

Replies are listed 'Best First'.
Re: update content without refreshing
by dws (Chancellor) on Jun 08, 2003 at 16:53 UTC
    I had been looking at ways to update content of a web page without using any auto refreshing meta.

    There's a way to do this using "pushlet" technology, but it's rather complicated (involving Frames, JavaScript, and persistent browser connections).

    The idea behind a pushlet is that a hidden frame keeps a long-running HTTP GET going to a server. The server dribbles out JavaScript commands, which get interpreted and executed by the browser as they arrive. These commands invoke JavaScript routines that are embedded in either a parent window or in another frame. Typically, a side-effect of this invocation is to refresh part or all of some visible frame.

    This collaboration requires that the server-side keep a long-running connection. Most off-the-shelf web servers will time connections out.

    KnowNow, Inc. pioneered this technology (though they didn't invent it). They also recently started a SourceForge project to release some of their code publicly.

    A google search on "pushlet" might turn up more usable info.

      I did something similar but different way back when I first started doing web stuff - except with client side server pull. My approach was to use a timer to reload an empty sub-frameset that wouldn't show up in the browser's display but served as a vehicle for Javascript.

      Makeshifts last the longest.

Re: update content without refreshing
by atcroft (Abbot) on Jun 08, 2003 at 18:03 UTC
Re: update content without refreshing
by BrowserUk (Patriarch) on Jun 08, 2003 at 17:05 UTC

    If your desire is to have one (or more) small parts of the screen update without the whole screen refreshing, you could try using iframe (and/or layer) tags around the area(s) to be updated and use meta refresh tags on the pages displayed there.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller


Re: update content without refreshing
by TomDLux (Vicar) on Jun 08, 2003 at 21:04 UTC

    If it's only limited components which have to change, check out OpenThought by Eric Andreychek. It's at CPAN.

    OpenThought is an interesting engine for communication between the web server and web page.

      Thanks for the plug :-)

      For those who haven't used it before, OpenThought is a web application framework which allows you to update portions of the screen without reloading the page.

         If it's only limited components which have to change

      OpenThought has grown a lot over the last year. There used to be a limitation that form elements were the only visual items which could be updated without refreshing the screen. However, that has now been extended into any HTML item with an "id" tag. Basically, that could be anything :-)

      You're also able to send in JavaScript code from the server, access existing JavaScript functions and variables, and sessions are automatically managed for you -- no more need for cookies or adding session id's to the end of each url. It's good stuff :-)

      There's a version in CVS that supports mod_perl 2.x and has some significant improvements in the installation system. It will hopefully be released within a few days. Good luck!
      -Eric

      --
      Lucy: "What happens if you practice the piano for 20 years and then end up not being rich and famous?"
      Schroeder: "The joy is in the playing."
Re: update content without refreshing
by The Mad Hatter (Priest) on Jun 08, 2003 at 16:29 UTC
    Uh, Activescores uses the meta refresh: <meta http-equiv="refresh" content=120> Royalscore doesn't refresh automatically for me.

    Why don't you want to use the meta refresh technique?

    Update The "old version" of Royalscore updates for me, but that also uses the meta refresh. If the link to Royalscore you provided updates for you, I'd guess it was some javascript hackery (there sure is a lot of it in the page).

Re: update content without refreshing
by Jenda (Abbot) on Jun 08, 2003 at 18:44 UTC

    DHTML?

    Jenda
    Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
       -- Rick Osborne

    Edit by castaway: Closed small tag in signature

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://264117]
Approved by arthas
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2024-04-19 08:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found