Solved

Button page refresh

Posted on 2014-03-13
9
309 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
[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
  • 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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
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
 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
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…

740 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