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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy need help with a jvs function which opens new window

    Can anyone help me with this?

    function gotoshow(){
    if (!window.winslide||winslide.closed)
    winslide=window.open(slidelinks[whichlink])
    else
    winslide.location=slidelinks[whichlink]
    winslide.focus()
    }


    I need to change this function to DO NOT open "slidelinks" in new window, but in same window as the image witch uses this function.

    Thanks a lot for help, I am a newbie in javascript...

  • #2
    Regular Coder
    Join Date
    Jul 2007
    Location
    UK
    Posts
    223
    Thanks
    0
    Thanked 14 Times in 14 Posts
    You need to set the location.href property to the required url, e.g.

    Code:
    function gotoshow(){
     location.href = slidelinks[whichlink];
    }
    P.S. "witch" is spelt "which" in this context.
    P.P.S. javascript is usually abbreviated to "js" not "jvs".

  • #3
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks a lot, mcjwb, it works.

    P.S.: english and js are not my native languages ))


  •  

    Posting Permissions

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