SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard
    Join Date
    Oct 2004
    Location
    Newport Beach
    Posts
    1,761
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript OnClick Href IFrame, but URL Returns After one Click

    I have an onclick event like so:

    <a href="javascript:;" target="slideshow" onClick="this.href='/slide.php?movie=thismovie&pg=1'; return true;">

    the iframe is named 'slideshow'

    I have a bunch of page number options that target the iframe such as this in order to avoid people opening a link into a new window (looks horrid).

    However, after I click the javascript:; link once, it all of a sudded places the full link back as the href. It works, but then if you were to click again into a NEW WINDOW, it will let you.

    First href it shows is "javascript:;", after one click it switches it back to "'/slide.php?movie=thismovie&pg=1".

    How do I stop it from doing this? I want only javascript:; shown as the href all the time... even after clicked.

    Thanks
    Ryan
    Upcoming Movies - Movie News. Updated Daily.
    Movie Trailers - Awesome trailer site. Nuff said.

  2. #2
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How about
    <a href="javascript:;" onclick="document.frames['slideshow'].location.href='/slide.php?movie=thismovie&pg=1'; return true;">

    ?


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
  •