SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member
    Join Date
    Apr 2000
    Location
    Bhopal, M.P., India
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello,

    Would somebody please tell me that when I revisit a page using the back button of my browser window, is there some way of refreshing the page, using Java Scripts, so that the old information on the page should not be retained and the page should be refreshed each time a user goes on it.

    Thanks in advance.

  2. #2
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sure, just use the following code:

    location.reload()

    ------------------
    Who the heck is Gen. Failure and why does he want to read my hard drive?
    Soon to come: Aspology.com

  3. #3
    SitePoint Member
    Join Date
    Apr 2000
    Location
    Bhopal, M.P., India
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks fro the code, but it does'nt seem to work. Can you suggest something else.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote/font><HR>Originally posted by d3v:
    Sure, just use the following code:

    location.reload()

    <HR></BLOCKQUOTE>


  4. #4
    pg for mild peril cow's Avatar
    Join Date
    Mar 2000
    Location
    nevada, usa
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what you need is to force the page to load each time someone hits it. i know there is a meta tag command for this, but i can't seem to find it...

    something about nocache...

    does anyone else know what it is???

    [This message has been edited by cow (edited May 18, 2000).]

  5. #5
    SitePoint Wizard jonese's Avatar
    Join Date
    Jul 1999
    Location
    Powder Springs GA (Atlanta)
    Posts
    1,238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    &lt;META HTTP-EQUIV="Pragma" CONTENT="no-cache"&gt;

    ------------------
    Eric Jones - SitePoint Administrator
    http://www.sitepoint.com
    eric@sitepoint.com

  6. #6
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Not all browsers respect the no-cache tag. The one I can think of in particular is IE5.01. It allows the user to determine if the page is cached or not within the Internet Options contol panel.

    Using the location.reload code can cause a endless loop if it works. Everytime your page loads the code would trigger. It is kind of a quandary here. To tell you the truth I think this would be very hard to force from a client side script.


    ------------------
    Wayne Luke - Sitepoint Moderator/Internet Media Developer
    Digital Magician Studios - Making Magic with Web Applications
    wluke@digitalmagician.com

  7. #7
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But if you put it into the OnClick event handler of, say, a submit button, then it would correctly reload your page.

    ------------------
    Who the heck is Gen. Failure and why does he want to read my hard drive?
    Soon to come: Aspology.com

  8. #8
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    OK here is a solution that I think would work. This would be controlled by the onload event of the body tag.

    Set a cookie with an expiration 30 seconds in the future. If the cookie doesn't exist then Reload the page. If it does then don't.

    Unfortunately I don't have any code written for it but I don't think it would be to hard for someone who knows Javascript to write it. If no one posts code then you can email me.


    ------------------
    Wayne Luke - Sitepoint Moderator/Internet Media Developer
    Digital Magician Studios - Making Magic with Web Applications
    wluke@digitalmagician.com


Bookmarks

Posting Permissions

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