Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts

    Open new window, redirect opener, keep focus on new window

    Long title, but it pretty much sums up what I'm trying to do. I have a page that opens a new window (say myNewWindow). Next I redirect the page which opened the window to my home page on the site (index.html). The problem I have is I want the new window to remain the focus after the opener page is redircected. Any ideas? I've tried several approaches like this

    Code:
    	myWin = window.open('http://mysite.com/selfservice/','newWin','alwaysRaised=1');
    	myWin.focus();
    	window.top.location='http://mysite.com/help/index.html';
    I've also tried this on the index.html page:

    Code:
    function checkWin() {
    	if(myWin) {
    		myWin.focus()
    	}
    	else {
    		alert("No window");
    	}
    }
    with an onload="checkWin()" in the body tag. But this doesn't work either.

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    not very clear to me...

    Yet try switch
    myWin = window.open('http://mysite.com/selfservice/','newWin','alwaysRaised=1');
    window.top.location='http://mysite.com/help/index.html';
    myWin.focus();
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •