[thelist] munged links javascript

John C Bullas jcbullas at nildram.co.uk
Mon Nov 24 13:16:40 CST 2003

At 17:43 24/11/2003, you wrote
>Certain paid-for links on my site are getting hammered by spiders.  I have 
>the idea that I can hide the links behind javascript and thwart the more 
>stupid spiders.  But, I can't figure out how to use javascript in such a 
>way that it won't go about opening a new window.
>Here's what I start with:
><a href="#" onClick="window.open('target_page.html',''); return 
>false;">Paid-for link</a>.


<script language="JavaScript">

var linkurl = "//www.linkurl.com";
var linktext = "linktext";

function print_munged_link()
    document.write("<A HREF=\"http");
    document.write(":" + linkurl );
    document.write( "\">" + linktext + "<\/a>");



<script language="JavaScript" type="text/javascript">

Just adding the target frame bit


>Now, I thought that I could change window.open to window.self and I'd be 
>just fine.  But, it doesn't do it.
>Any ideas?  Or, any other ideas for how I can obfuscate these links 
>from  spiders while still making them usable by humans?

More information about the thelist mailing list