href or onClick?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Roderik

    #1

    href or onClick?

    What is preferable?

    <a href="javascrip t:my_function() ;">hyperlink </a>

    or

    <a href="#" onClick="my_fun ction();">hyper link</a>

    --

    webdesign, internet applicaties, internetgestuur de elektronica
  • Lee

    #2
    Re: href or onClick?

    Roderik said:[color=blue]
    >
    >What is preferable?
    >
    ><a href="javascrip t:my_function() ;">hyperlink </a>
    >
    >or
    >
    ><a href="#" onClick="my_fun ction();">hyper link</a>\[/color]

    <a href="pageExpla iningThatJavasc riptIsNotEnable d.html"
    onclick="my_fun ction();return false">hyperlin k</a>

    Returning false from the onclick handler is important
    to prevent the link from being followed. Even if the
    link is "#", that will cause most browsers to jump to
    the top of the current page.

    Comment

    • Ivo

      #3
      Re: href or onClick?

      "Roderik" wrote[color=blue]
      > What is preferable?
      >
      > <a href="javascrip t:my_function() ;">hyperlink </a>
      >
      > or
      >
      > <a href="#" onClick="my_fun ction();">hyper link</a>[/color]

      See the FAQ:
      <URL: http://jibbering.com/faq/#FAQ4_24 >


      Comment

      • Thomas 'PointedEars' Lahn

        #4
        Re: href or onClick?

        Roderik wrote:
        [color=blue]
        > What is preferable?
        >
        > <a href="javascrip t:my_function() ;">hyperlink </a>
        >
        > or
        >
        > <a href="#" onClick="my_fun ction();">hyper link</a>[/color]

        Neither one is.


        PointedEars

        Comment

        Working...