Find the answer to your Linux question:
Results 1 to 4 of 4

Thread: Auto refresh

Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Auto refresh


    Hi all
    i have a fedora 15 LXDE

    I have a web based ticketing system that i need to have it refresh every X minutes.
    however the refresh button reloads the page but does not grap new contents. there is a button to refresh each pain of the page that grabs the new info.
    Apperantly i need some kind of script in order to have that button(link) refresh every so often.
    Im stuck as im not a scriptor nor linux guru

    Can you help me out here?

    Thanks

  2. #2
    Sounds like you need a bit of javascript. What I would do is:

    1. throw together a javascript function that invokes that button

    2. have that function called whenever the page loads (via the javascript body onload event)

    3. use meta refresh element to have the page auto-refresh every 5 seconds (or whatever number you want) - note: using meta refresh is legacy, but hey it works for me

    E.g.:
    Code:
    <html>
    <head>
    <meta http-equiv="REFRESH" content="5">
    <script type='text/javascript'>
      function invoke_reload_button() {
        // do stuff to invoke that button
      }
    </script>
    </head>
    <body onload="invoke_reload_button()">
    html code blah blah
    cool button, etc.
    </body>
    </html>

  3. #3
    2. have that function called whenever the page loads (via the javascript body onload event)

    How would i do that ?

  4. $spacer_open
    $spacer_close
  5. #4
    Quote Originally Posted by chefo View Post
    2. have that function called whenever the page loads (via the javascript body onload event)

    How would i do that ?
    This portion of the code I posted does that:
    Code:
    <body onload="invoke_reload_button()">
    The onload portion is a Javascript event. See here for more info.

    It says that every time the page is loaded (either via the browser refresh button, or any HTML that causes the page to reload) call the invoke_reload_button javascription function - which of course must be defined by you.

Posting Permissions

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