• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 725
  • Last Modified:

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
0
ryankahan
Asked:
ryankahan
1 Solution
 
Dave BaldwinFixer of ProblemsCommented:
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.
0
 
Michel PlungjanIT ExpertCommented:
can you try showModalDialog(url)
instead
0
 
Pacemaker9007Commented:
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
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
ryankahanAuthor Commented:
Hi,

It seems that what I am trying to do is not possible using java as it has no O/S control so if the browser itself does not have focus then neither will the window.

I am going to work around this by creating an exe to do what I need and then calling it via scripting (although this will only work with IE).
0
 
Michel PlungjanIT ExpertCommented:
Yes you can also create an HTA instead of an exe.
0
 
ryankahanAuthor Commented:
Updated, it does not appear to be possible to do what I initially wanted.
0
 
Michel PlungjanIT ExpertCommented:
So Dave' comment is correct.
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now