avoiding jump with <a href="#" onclick="window.open....

Discussion in 'Javascript' started by jodleren, Feb 15, 2007.

  1. jodleren

    jodleren Guest

    Hi all

    I have a file I open in a smaller window, like this:

    <a href="#" onclick="window.open....

    but it also causes the main window to jump to the top. What have
    people done to avoid that?

    BR
    Sonnich
     
    jodleren, Feb 15, 2007
    #1
    1. Advertising

  2. jodleren

    Randy Webb Guest

    jodleren said the following on 2/15/2007 7:31 AM:
    > Hi all
    >
    > I have a file I open in a smaller window, like this:
    >
    > <a href="#" onclick="window.open....
    >
    > but it also causes the main window to jump to the top. What have
    > people done to avoid that?


    onclick="window.open('.....');return false"

    --
    Randy
    Chance Favors The Prepared Mind
    comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
     
    Randy Webb, Feb 15, 2007
    #2
    1. Advertising

  3. jodleren

    Evertjan. Guest

    Randy Webb wrote on 15 feb 2007 in comp.lang.javascript:

    > jodleren said the following on 2/15/2007 7:31 AM:
    >> Hi all
    >>
    >> I have a file I open in a smaller window, like this:
    >>
    >> <a href="#" onclick="window.open....
    >>
    >> but it also causes the main window to jump to the top. What have
    >> people done to avoid that?

    >
    > onclick="window.open('.....');return false"
    >


    .... unless the modern IE/FF browser is set to always tab.

    ===============

    What about gracefull
    retardation/recreation/retalliation/what-was-that-d'mn-word-again?

    <a
    href='http://cnn.com/' target='_blank'
    onclick='window.open(this.href);return false'
    >

    CNN
    </a>

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Feb 15, 2007
    #3
  4. On Feb 15, 12:31 pm, "jodleren" <> wrote:
    > Hi all
    >
    > I have a file I open in a smaller window, like this:
    >
    > <a href="#" onclick="window.open....


    http://www.jibbering.com/faq/#FAQ4_24

    " Instead, use <a href="something.html" onclick="somefunction();return
    false"> where something.html is a meaningful alternative. "
     
    David Dorward, Feb 15, 2007
    #4
  5. jodleren

    jodleren Guest

    On Feb 15, 5:41 pm, "David Dorward" <> wrote:
    > On Feb 15, 12:31 pm, "jodleren" <> wrote:
    >
    > > Hi all

    >
    > > I have a file I open in a smaller window, like this:

    >
    > > <a href="#" onclick="window.open....

    >
    > http://www.jibbering.com/faq/#FAQ4_24
    >
    > " Instead, use <a href="something.html" onclick="somefunction();return
    > false"> where something.html is a meaningful alternative. "


    I changed then items to buttons, it also makes more sence it that
    place.

    BR&Thanks
    Sonnich
     
    jodleren, Feb 16, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. CRON
    Replies:
    24
    Views:
    200,843
    Adrienne Boswell
    Jun 20, 2006
  2. saiho.yuen
    Replies:
    3
    Views:
    437
    kaeli
    Sep 14, 2004
  3. Replies:
    2
    Views:
    482
  4. Vincent van Beveren

    BASE HREF and A HREF="#" onclick="..."

    Vincent van Beveren, Jul 6, 2006, in forum: Javascript
    Replies:
    2
    Views:
    331
    Vincent van Beveren
    Jul 6, 2006
  5. Eadwine Rose
    Replies:
    2
    Views:
    215
    Eadwine Rose
    Oct 15, 2006
Loading...

Share This Page