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

x
?
Solved

how can I referesh my page?

Posted on 2016-10-18
4
Medium Priority
?
75 Views
Last Modified: 2016-10-18
how can I refersh my page if user use back button on my web site?

I have a form which has a javascript function, if the user select one of my menü, the other menu comes up with the related data,
however if user use back button instead of the link, the second menu doesn't comes up with a data

if I refersh the page, problem will be solved.
my pages are php
0
Comment
Question by:Braveheartli
[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
  • 2
4 Comments
 
LVL 1

Author Comment

by:Braveheartli
ID: 41848064
I use this code and it works

    <input type="hidden" id="refreshed" value="no">
<script type="text/javascript">
onload=function(){
var e=document.getElementById("refreshed");
if(e.value=="no")e.value="yes";
else{e.value="no";location.reload();}
}
</script>
0
 
LVL 23

Accepted Solution

by:
Ferruccio Accalai earned 1000 total points
ID: 41848066
Another way is to use meta tags in head section

<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
<meta http-equiv="Expires" content="Mon, 26 Jul 1997 05:00:00 GMT">
</head>

Open in new window

0
 
LVL 2

Assisted Solution

by:Amita Singh
Amita Singh earned 1000 total points
ID: 41848069
try this
window.onpageshow = function(event) {
    if (event.persisted) {
        window.location.reload() 
    }
};

Open in new window

0
 
LVL 1

Author Closing Comment

by:Braveheartli
ID: 41848072
thank you both
0

Featured Post

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

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

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

649 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