Solved

Button page refresh

Posted on 2014-03-13
9
293 Views
Last Modified: 2014-03-13
Hi Experts,

I have button on my page which has this code

$('#Button1').click(function() {
                location.reload();
            });

The problem is that in IE8-9 it prompts popup if I would close this tab.

Is there workaround this issue ?

Thanks.
0
Comment
Question by:fpoyavo
  • 4
  • 4
9 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39928189
What does the prompt say?
prompts popup if I would close this tab
Are you reloading the page or closing it?

Instead of location.reload() try
window.location.href = window.location.href
0
 
LVL 82

Expert Comment

by:leakim971
ID: 39928191
I don't the prompts popup on the following link : http://fiddle.jshell.net/6Ux2F/1/show/

And you?
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 39928208
Gary,

Same thing. "The page you are viewing is trying to close this tab. Would like to close or continue?"

That's odd....
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39928219
Do you have any other javascript firing on page unload?

Does leakims example give you the same alert?
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 1

Author Comment

by:fpoyavo
ID: 39928221
Yes I do. It actually closes child windows but why do you think they are related ? if so how do I keep both ?
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 39928224
You are right man !!!
0
 
LVL 58

Expert Comment

by:Gary
ID: 39928225
It's nothing to do with the page you are reloading, its the child windows closing that is firing the alert.
0
 
LVL 58

Expert Comment

by:Gary
ID: 39928231
That's not really an answer...
What you would need to do is close the child windows in the button click code, then you shouldn't get any alerts.
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 39928282
I have no opened child windows at the time when I click this button to refresh.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

708 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now