#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    5
    Rep Power
    0

    <body onLoad="window.location.reload()">


    Hi,

    Is there any way to just make this statement execute just once?

    Everytime I load the page is continuously reloads forever. How do I just make it reload on entry once?

    Thanx
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Location
    Bangalore
    Posts
    2
    Rep Power
    0

    Thumbs up Look at this !!


    go to this place...

    http://grizzlyweb.com/webmaster/javascripts/refresh.asp

    got it from google for you ...



    this may be the way to do it, no point reinventing the wheel...
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    3
    Rep Power
    0
    But each of the methods in this page provide a method which will reload/refresh the page continually after a given time interval.
    I am in the same position here and have tried to think of numerous ways to simply perform a reload/refresh of the current page only once upon the user entering the page (as I have active content which is build from a CGI script in the background but uses a javascript tree-menu to display it - the content of the tree items is regenerated fine by the CGI script but the javascript tree-menu does not update without a refresh).
    Can somebody help??
  6. #4
  7. Cunning Linguist
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2003
    Location
    I used to live at home, now I stay at the house
    Posts
    10,180
    Rep Power
    2039
    Welcome to the Forums Ian!

    The most relaible way to do it, would be to set a cookie, and make a function that searches for the cookie, and if present, doesn't refresh, but if it's not there, make on and then refresh...

    This, however, is a much easier way, allthough it is sort of cheating...

    <body onLoad="setTimeout('window.location.reload();',9999999999)">

    Means it won't refresh again for a few days after initial load!!!!
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    3
    Rep Power
    0
    Thanks for the quick reply but it doesn't seem as though the cheat actually works otherwise it would have been ideal.

    I don't think that using the setTimeout function actually performs the initial reload of a page when first entered. It will only do it after the time provided - I need that initial refresh/reload.
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Location
    Bangalore
    Posts
    2
    Rep Power
    0

    Use LAMP, WAMP or XAMP


    there is only one way out of this..................

    use LAMP Linux Apache Mysql Php
    or WAMP W is windows
    or XAMP X is Mac OS X

    in LAMP you can reinvent the universe.


IMN logo majestic logo threadwatch logo seochat tools logo