?
Solved

how can I referesh my page?

Posted on 2016-10-18
4
Medium Priority
?
68 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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 …
Suggested Courses

801 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