www.webdeveloper.com
Results 1 to 3 of 3

Thread: Inline Javascript to open window and check its already open

Hybrid View

  1. #1
    Join Date
    Jun 2013
    Posts
    2

    Inline Javascript to open window and check its already open

    Hi, thanks for the help in advance. I'm more of a web designer but I have an issue that's stumping me.

    Scenario: If a user clicks on a link that links needs to open in a new window, but if that link/window is already open i'd rather just have it come to the front of the page. I need it to be inline javascript because i dont have access to add in <script> tags . Is this even possible to do? I'd been looking for nearly 2 hours and I know inline isn't best practice but I can't do much about it.

    Thanks!

  2. #2
    Join Date
    Apr 2012
    Posts
    22
    Try to give an unique name of the new window as second parapeter of window.open(). This will not focus the window in case of second click, but at least will not open new one.

  3. #3
    Join Date
    Jun 2013
    Posts
    2
    Thanks, onclick="var win1=window.open(this.href, 'win1', ''); win1.focus(); return false;" works nicely for me and if anyone else needs to do the same thing....just change the win1 for separate links.

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