Callback to parent function from child not working in IE?
I have the functions below and they work fine in firefox and chrome but dont seem to work in IE.
Is this because IE opens in new windows and not tabs like the others?
Parent JS
var wnd = null;
function openPdf() {
wnd = window.open('www.example.com');
}
function closeWnd() {
if (wnd != null) {
wnd.close();
开发者_Python百科 }
alert('Closed');
}
Child JS
function parent_callback() {
setTimeout("window.opener.closeWnd()",2000);
}
Thanks
wont fix the whole problem but will improve at least
function parent_callback() {
setTimeout(function (){
window.opener.close();
},2000);
}
show your error for a better solution
精彩评论