Click here to Skip to main content
15,887,676 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi I have an web application runs inside a iframe ,if I do zoom(+ or -) in IE and Chrome ,the application reload and take me to start page .

is there any solution for this?

What I have tried:

I am trying to put bellow java script code in iFrame page
window.onbeforeunload = function(){
return false; // This will stop the redirecting.
}
an alert will come .I don't need this alert .
Posted
Comments
Richard Deeming 9-May-16 9:12am    
If script on the page could prevent the browser from navigating away from that page without asking the user for permission, don't you think every spam/malware/porn site would be doing it?

Rather than trying to solve the impossible, you should be trying to work out why your page reloads when you zoom. It doesn't seem to happen on any other site, so what is your site doing that's causing the problem?
Sergey Alexandrovich Kryukov 9-May-16 10:01am    
Exactly.
—SA
KuntalBose 9-May-16 12:24pm    
I found bellow code inside document ready event
function resizedw(appwidth) {
var window_changed = $(window).width() != appwidth;
if ($(window).width() != appwidth) {
console.log(location)
//location.href = location.href;
location.reload();
}
past_width = $(window).width();
}
and location.reload(); reload the same page in mozzilla ,but in chrome and IE its reload the initial SRC page of the iframe .

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900