48 users online (1 members and 47 guests)  


  Results 1 to 6 of 6

Related

  1. href + javascript onlick event    Forum: HTML Forum
    Replies: 4
  2. onClick and <iframe>    Forum: HTML Forum
    Replies: 4
  3. refresh popup window using javascript    Forum: Javascript Forum
    Replies: 3
  4. Javascript onclick Event Handler:    Forum: Javascript Forum
    Replies: 3
  5. returning value from an onclick event    Forum: Javascript Forum
    Replies: 3
  1. #1
    vicky100's Avatar
    New User

    Status
    Offline
    Join Date
    Sep 2004
    Posts
    2

    Question javascript onclick event to refresh iframe.

    I got 2 frames, iframe1 and iframe2.
    I want to refresh iframe2 when i click an link in iframe1.
    This i did by writing the onclick event.

    javascriptnclick=refreshscreen(requestno);return true;

    However by doing this the iframe1 also gets refreshed.
    How to stop that ???

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    In the link, the href is being processed by the click as well.

    make the href this:

    Code:
    href="javascript:void(0);"
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    dlongnecker's Avatar
    Tired Student...(Z_z)

    Status
    Offline
    Join Date
    Aug 2004
    Location
    Wichita, KS
    Posts
    86
    Hmm... I've always set it to:

    HTML Code:
    <a href="#" onClick="javascript: important code(goes here);">My New Link</a>
    Pro/con to the void statement? (^_^)

    Thanks!

    -David

  4. #4
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    the '#' is a valid url, so it reloads the page. The void does, well, nothing. So the page does not reload.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  5. #5
    vicky100's Avatar
    New User

    Status
    Offline
    Join Date
    Sep 2004
    Posts
    2

    Red face

    Its working.

    Thanks a lot.

  6. #6
    dlongnecker's Avatar
    Tired Student...(Z_z)

    Status
    Offline
    Join Date
    Aug 2004
    Location
    Wichita, KS
    Posts
    86
    Haha.. awesome.. one worked--never tried another way. Thanks! (^_^)

    -David