SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    Learning...
    Join Date
    Jan 2003
    Posts
    778
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Opening a link in new window

    I have a button called LOOKUP, which when clicked calls a client side function that increments the nLookUp by 1 and then should open the target URL in new window. How can i accomplist this from cllient side scripting?

    <script language="javascript">
    <!--

    var nLookUp = 0

    function DoLookUp(){
    nLookUp++;
    location.href = "target URL";
    }
    //-->
    </script>

    Here location.href will open the target URL in the same window.

  2. #2
    American't awestmoreland's Avatar
    Join Date
    Sep 2002
    Location
    Grand Rapids, MI
    Posts
    1,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    From the English nation to a US location.

  3. #3
    Learning...
    Join Date
    Jan 2003
    Posts
    778
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this will open a pop up window????

    want to have similar effect as target=_blank

  4. #4
    googlicious graymatter bvarvel's Avatar
    Join Date
    Sep 2002
    Location
    Katy, TX
    Posts
    956
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yep. you can even control the look of the popup window.

  5. #5
    Learning...
    Join Date
    Jan 2003
    Posts
    778
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    problem is pop up stoppers, don't want any thing to stop this from displaying.

  6. #6
    American't awestmoreland's Avatar
    Join Date
    Sep 2002
    Location
    Grand Rapids, MI
    Posts
    1,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by tahirjadoon
    problem is pop up stoppers, don't want any thing to stop this from displaying.
    It's all in the terminology. You want to open a new window. Regardless of the window's size or content, this new window is a pop-up and that will mean that pop-up stoppers will act on it.

    There's no way round that. That's why pop-up stoppers exist, precisely to prevent you doing what you're attempting. You either have to live with the fact that not everyone is going to see your pop-up or find some other way to achieve the same thing.

    If you go down the route of using a pop-up, I would make sure that you make the user aware that the link will open in a new window then they can temporarily disable their pop-up stopper if they trust your content.


    Andy
    From the English nation to a US location.


Bookmarks

Posting Permissions

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