vendredi 27 février 2015

Cannot close popup() window in iPhone Safari

I wrote a simple script which should close popup window opened by user click (onclick). However, it does not work in Apple iPhone device which I use to test (iOs 8.1), but seems to work everywhere else.


I found an information about bug in safari HERE


but I wonder is there any workaround which can help make it work for people who using version 8.1?



function popitup(url, windowName) {
var newwindow = window.open(url, windowName, 'height=10px,width=10px,top=5000,left=5000,location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,channelmode=0,directories=0,fullscreen=0');
newwindow.addEventListener('load', function() {
//close popup
newwindow.close();
window.focus();
//redirecting main window
window.location.href = "<?php echo $site_url; ?>/gt/ts";
});
return false;
}


Thanks!




Aucun commentaire:

Enregistrer un commentaire