I have a very wierd error cropping up in IE.
I am opening a window, with a specific url , and closing it immidiately, using the following code:
openSomething(guid)
{
my_window = window.open("outlook:"+guid,"mywindow","width=0,hei开发者_如何转开发ght=0");
my_window.close();
}
This script outputs things as expected, i.e this opens the right outlook mail needed, but IE window shows the error "my_window null or not an object".
Can someone please tell me what is wrong here??
That usually happens when the window is blocked by a/the popup blocker. You'll need to make sure that window.open
actually returns a window:
my_window = window.open("outlook:"+guid,"mywindow","width=0,height=0");
if (my_window && my_window.close) {
my_window.close();
}
精彩评论