• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 325
  • Last Modified:

Button page refresh

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
fpoyavo
Asked:
fpoyavo
  • 4
  • 4
1 Solution
 
GaryCommented:
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
 
leakim971PluritechnicianCommented:
I don't the prompts popup on the following link : http://fiddle.jshell.net/6Ux2F/1/show/

And you?
0
 
fpoyavoAuthor Commented:
Gary,

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

That's odd....
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
GaryCommented:
Do you have any other javascript firing on page unload?

Does leakims example give you the same alert?
0
 
fpoyavoAuthor Commented:
Yes I do. It actually closes child windows but why do you think they are related ? if so how do I keep both ?
0
 
fpoyavoAuthor Commented:
You are right man !!!
0
 
GaryCommented:
It's nothing to do with the page you are reloading, its the child windows closing that is firing the alert.
0
 
GaryCommented:
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
 
fpoyavoAuthor Commented:
I have no opened child windows at the time when I click this button to refresh.
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now