Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make new IE window take focus

Status
Not open for further replies.

philcha

Programmer
Joined
May 10, 2000
Messages
109
Location
GB
I want to use the same window for various pop-up pages, to avoid swamping the users' PC with new windows.
In IE if the target window already exists it does not automatically take the focus (appear on top) when the new page is loaded into it.
How can I make the new page take the focus automatically when it's finished loading, in all versions of IE from 4 upwards, without creating any page elements which have no other purpose?
window.focus() seems to have no effect in IE. Microsoft's DHTML reference pages suggest IE is moving towards only acting on the focus method for form elements ("must have tabindex") but the pages I want to show have no need for forms.
 
window.onload=focusit

function focusit(){
top.focus()
}
 
or from the page u're openin it:


var wnd=window.open('','','')//(your routine features)
if(wnd.document.readystate==4)//completely loaded
wnd.focus()

didnt checked, but think must be workin

get luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top