Jump to content

What's A Good Way To Stall Javascript


dickey38

Recommended Posts

I have javascript containing:auxwndw = window.open('mypage');auxwndw.focus();I got an error in IE 'auxwndw is null or not an object'.I assume the 2nd line of code executed before the first line had completed the window-open operation.What's a good way to "stall" the script to avoid this?Thanks.

Link to comment
Share on other sites

window.open should be synchronous, so it should wait for that to return before it moves on to the next line. Does this restriction apply to you:

Internet Explorer 7 on Windows Vista: Opening a new window from an application (other than the Internet Explorer process) may result in a null return value. This restriction occurs because Internet Explorer runs in protected mode by default. One facet of protected mode prevents applications from having priveledged access to Internet Explorer when that access spans process boundaries. Opening a new window by using this method generates a new process. For more information about protected mode, see Understanding and Working in Protected Mode Internet Explorer. This commonly occurs for applications that host the WebBrowser control.
Link to comment
Share on other sites

window.open should be synchronous, so it should wait for that to return before it moves on to the next line. Does this restriction apply to you:
Thanks for info, but I don't think this applies. The js code is running from an html page rendered from a .aspx page, and I've taken care to keep postbacks from happening.Anyway, I guess the focus() statement is redundant so I've taken it out.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...