SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Guru kili's Avatar
    Join Date
    Jan 2004
    Location
    Damn I need a Crap
    Posts
    788
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Hyperlink through javascript

    Hi Guys can any paste a simple javascript code for using with hyperlinks. I want to do this so the search engines dont spider my outgoing links.
    I'm crap at coding apprciate an example I can use

    Note:These are not reciprocal Links

    Cheers
    Kili

  2. #2
    SitePoint Enthusiast
    Join Date
    Aug 2002
    Location
    Provo Utah
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The se's are starting to read javascript/dhtml links. Just out of curiousity why?

    I use one to open a new window for some links
    Code:
    <a href="link.html" onClick="window.open('link.html', 'windowname', 'status=no,resizable=no,scrollbars=no,width=550,height=433'); return false"> Link </a>
    http://www.eransworld.com -bored look at my boring website

  3. #3
    SitePoint Guru kili's Avatar
    Join Date
    Jan 2004
    Location
    Damn I need a Crap
    Posts
    788
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Colorspots. You gussed correctly it's to prevent the SE's indexing the link. From your statment this seems to have changed.

    I'm not sure how to procced now.
    How do you know this?
    Does this apply to Google as well?

    Cheers Kili

  4. #4
    SitePoint Guru kili's Avatar
    Join Date
    Jan 2004
    Location
    Damn I need a Crap
    Posts
    788
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The code shown opens in a small window I would like it to simply take the user to a full size page.

    Any one post the javascript to do this please.

    Cheers Kili

  5. #5
    SitePoint Wizard trampt's Avatar
    Join Date
    Jan 2003
    Location
    Newport, RI
    Posts
    1,997
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think what he is asking is just to have an external link open in a new window (ie "_blank") so no PR transfers to the other web site.

    I am curious on an easy way to do this with javascript as well.

  6. #6
    SitePoint Guru kili's Avatar
    Join Date
    Jan 2004
    Location
    Damn I need a Crap
    Posts
    788
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thats it the404.com . Excatly what I want

    Kili

  7. #7
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    A server-side redirect is your best bet. It will still work even if Javascript is turned off. Just tell the search engines not to spider the redirect page (in robots.txt). Here's a quick sample and sample url:
    PHP Code:
    <?php
    /*redirect.php*/
    $uri $_GET['uri'];
    header("Location: $uri");
    ?>
    Sample URL:
    Code:
    http://example.com/redirect?uri=http://www.othersite.com/
    This will keep the pagerank from leaking and still be accessible to all browsers whether JS is disabled or not.


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
  •