[thelist] munged links javascript

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


At 19:16 24/11/2003, John C Bullas wrote
>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>.

Try this somewhat messy banged together JS:

(edit values for linkurl &linktext and edit "_blank" to your desired frame 
reference......

<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("\" Target=\"_blank\">" + linktext + "<\/a>");

}

//-->
</script>

<script language="JavaScript" type="text/javascript">
    print_munged_link()
</script>

FB
Listowner
java-script-world at yahoogroups.com 



More information about the thelist mailing list