www.webdeveloper.com
Results 1 to 3 of 3

Thread: window.focus() once again

Hybrid View

  1. #1
    Join Date
    Nov 2010
    Posts
    2

    window.focus() once again

    I have discovered that people have problems with focusing the newly opened window. There are a lot of examples like that in the Internet.

    I would like to have a focus on my new window opener. I have try so many things:

    Code:
    function openSubmit() {
    		var newWindow = window.open('http://example.com', "new window");
    		newWindow.opener.window.focus();
    		newWindow.opener.focus();
    		window.focus();
    }
    But after the invocation of this function the newly created window is always focused - and I would like the old window to be focused and the new one - opened 'in the background'.

    Anyone have a working example?
    Regards,
    Mark

  2. #2
    Join Date
    Dec 2002
    Location
    St. Louis, MO, USA
    Posts
    1,582
    In the newly opened window, put:
    Code:
    opener.window.focus();

  3. #3
    Join Date
    Nov 2010
    Posts
    2
    I can not modify the code of newly opened page.

    So there is no way to set focus on the opener by modifying the opener's code only?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles