Solved

Button page refresh

Posted on 2014-03-13
9
310 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
Business Impact of IT Communications

What are the business impacts of how well businesses communicate during an IT incident? Targeting, speed, and transparency all matter. Find out more in this infographic.

 
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

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

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

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

688 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