Thread: Reload Function
View Single Post
Old 09-07-2012, 05:47 PM   PM User | #1
durangod
Senior Coder

 
Join Date: Nov 2010
Posts: 1,177
Thanks: 214
Thanked 31 Times in 30 Posts
durangod is on a distinguished road
Reload Function

Hi, i have a graph on a page that has two options, if you click "sign up" it shows how many people signed up in the last 10 days.
If you click "login" it shows you how many people logged in the last 10 days.

Here is my delima, it defaults to "login" when i click signup the page reloads but graph does not change until i click the refresh
in the browser (my guess is that at first it is getting it from cache) when click refresh or f5 then it changes the graph

this happens vice versa too, the graph does not change content until i press f5 or refresh the browser.

So what i did is i did a function.


Code:
<script>
function reloadthepage()
  {
  location.reload(true)
  }
</script>
Then i put the line.

Code:
<a href="<?=$_SERVER['PHP_SELF']?>?gra=sign" onClick="reloadthepage()">Sign Up</a> - <a href="<?=$_SERVER['PHP_SELF']?>" onClick="reloadthepage()">Login</a></div><img src="mygraph.jpg">
But it is still not working until i press f5 or the refresh icon on the browser. I thought the "true" option forced it to get it from the server and not cache?

Any ideas here, thanks...
durangod is offline   Reply With Quote