dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: this.window.focus()

  1. #1
    Join Date
    Aug 2003
    Location
    Sydney, Australia
    Posts
    700

    this.window.focus()

    I have a script that opens a report in a new browser window (via target='_blank'). Unfortunately, in all browsers, it opens in the background.

    No... it's NOT opened via pop-up, nor is it practical to open it via pop-up.
    It's also not practical to give the new window a name (target='name') because it is possible for a user to open multiple such windows.

    The script that loads into the new window needs to contain some javascript that focuses the browser onto that window, bringing it to the foreground.

    In that new window, I've tried:
    this.window.focus()
    this.focus()
    window.focus()

    I've tried all of the above:
    in an onLoad within the body tag (<body onLoad='this.window.focus()'>
    within a javascript block at the end of the script (<script type='text/javascript>this.window.focus()</script>)

    No combination has worked.

    Any suggestions?

    Thanks
    CTB

  2. #2
    Join Date
    Dec 2002
    Location
    St. Louis, MO, USA
    Posts
    1,582
    window.onload = this.focus();

Thread Information

Users Browsing this Thread

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

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