Link to home
Start Free TrialLog in
Avatar of ryankahan
ryankahan

asked on

Bring Internet Explorer to front - Java Script

Hi,

Im using Java Script to open a new browser window using the following code:

win = window.open(url,"12345","width=400,height=200").focus();

The issue is that I want the browser (Internet Explorer) to get focus, not only the page in the browser.

Is there anyway to bring the actual browser to the front?

Thanks
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

I doubt that there is since that requires accessing the local machine and javascript is not supposed to be able to do that because it is considered a security risk.
can you try showModalDialog(url)
instead
Try it like this:
win = window.open(url,"12345","width=400,height=200");
win.focus();

Or try to look here:

http://www.netmechanic.com/news/vol5/javascript_no24.htm

Or here:

http://www.java2s.com/Code/JavaScript/Window-Browser/Windowfocusandblur.htm
ASKER CERTIFIED SOLUTION
Avatar of ryankahan
ryankahan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes you can also create an HTA instead of an exe.
Avatar of ryankahan
ryankahan

ASKER

Updated, it does not appear to be possible to do what I initially wanted.
So Dave' comment is correct.