[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

I need to command HTML to reload a site on opening so it is guarenteed current

Posted on 2003-11-16
10
Medium Priority
?
284 Views
Last Modified: 2010-04-09
I finally got the frames all figured out but know it doesn't refresh the page automatically to guarentee its correctness.  The only way I can see it most current is by clearing the web content on my PC and coming back.  The navigational bar is programmed in JavaScript and mainly everything else is in HTML.

Site: http://www.freewebs.com/demogovclan/

Note: The only page with info thus far is the News page.
0
Comment
Question by:FordGT90Concept
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
10 Comments
 
LVL 11

Accepted Solution

by:
Zontar earned 500 total points
ID: 9761026
Put these inside the <head>...</head> tags

<meta http-equiv="Content-Expires" content="Tue, 01 Jan 1980 12:00:00 GMT">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
0
 

Author Comment

by:FordGT90Concept
ID: 9761034
not a clue what those lines mean but i'll give it a go...
0
 

Author Comment

by:FordGT90Concept
ID: 9761057
<HEAD>
<meta http-equiv="Content-Expires" content="Tue, 01 Jan 1980 12:00:00 GMT">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
</HEAD>

Is what I added and it didn't work :(
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:FordGT90Concept
ID: 9761084
Ah, I had to empty the history first then refresh.  So far so good.  Thanks for the help.
0
 
LVL 11

Expert Comment

by:Zontar
ID: 9761110
Another trick is to place the following JS code in all your pages:
<script type="text/javascript">
window.onload = fixLinks;

function fixLinks()
{
  var timeStamp = new Date().getTime();

  if(document.links[0].search.indexOf("?") == -1 && self.location.href.indexOf("?ts=") == -1)
  {
    self.location.href += "?ts=" + timeStamp;
  }
  else
  {
    var allLinks = document.links;

    for(var i = 0; i < allLinks.length; i++)
      allLinks[i].href += (allLinks[i].href.indexOf("?") != -1 ? "&" : "") + "?ts=" + timeStamp;
  }
}
</script>

This adds a querystring in the form of a millisecond timestamp to all the links on your pages, which will make the browser think it's not visited them before.
0
 
LVL 11

Expert Comment

by:Zontar
ID: 9761116
>  Ah, I had to empty the history first then refresh.

LOL, no worries there, mate, my pleasure.
0
 

Author Comment

by:FordGT90Concept
ID: 9761136
should the HTML coded one be placed on every page or which ones?
0
 
LVL 11

Expert Comment

by:Zontar
ID: 9761533
All of them. Any page you don't want to be cached.
0
 

Author Comment

by:FordGT90Concept
ID: 9761573
Okay, thanks again for the help.
0
 
LVL 11

Expert Comment

by:Zontar
ID: 9761743
No worries. :^)
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question