www.webdeveloper.com
Results 1 to 4 of 4

Thread: Help me with this onclick thing

Hybrid View

  1. #1
    Join Date
    Oct 2009
    Posts
    1

    Help me with this onclick thing

    Here's my link:

    <a href='javascript://' onclick="Showpopup('baby');">Baby</a>

    How would I call this link in JavaScript:

    http://babyrus.com

  2. #2
    Join Date
    Nov 2002
    Posts
    4,473
    If you don't mind my rework
    Code:
    <a href="http://babyrus.com" target="_blank" onclick="Showpopup(this.href);return false">Baby</a>
    this would serve better, as if someone does not have javascript enabled, they would still get the link, in a new window.

    I hope someone does not add a comment that "target" is deprecated. It still works, and IMHO, whatever eurocrat decided to deprecate the tag should be dismissed with extreme prejudice.

  3. #3
    Join Date
    Oct 2009
    Posts
    21
    Quote Originally Posted by gil davis View Post
    If you don't mind my rework
    Code:
    <a href="http://babyrus.com" target="_blank" onclick="Showpopup(this.href);return false">Baby</a>
    this would serve better, as if someone does not have javascript enabled, they would still get the link, in a new window.

    I hope someone does not add a comment that "target" is deprecated. It still works, and IMHO, whatever eurocrat decided to deprecate the tag should be dismissed with extreme prejudice.
    sorry but i wanna know the return false; is this case mean what ??!!

    many thanks!

  4. #4
    Join Date
    Jul 2009
    Posts
    62
    return false; means that if javascript is enabled the function Showpopup(this.href) runs and the default action of the link wont execute which is href="http://babyrus.com" target="_blank" (opens that link in new window).
    Check Out My latest Project TheChozenFew (TCF). Some interesting stuff are going on there.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles