JavaScript to recombine text ?

michaelsanford

Translator, Web Developer
To prevent too much Trackback SPAM I was thinking of masking the trackback URL by encoding the link text in PHP (using, say, a ROT13 or other code, doesn't have to be complex at all, just not clickable) then, using JavaScript, decode the string to a readable URL.

This should prevent most spiders from even finding the URL in the first place since I'm hoping to make it triggered by an on.mouseover(). (say "Hover to see TrackBack URL"), I think most spiders don't parse that kind of thing.

The basic idea is that I need to encode the string somehow...if the URL/email whatever is plaintext in the HTML file and just revealed in an on,mouseover() it's virtually useless.

So, since on.mouseover() has exhausted ALL my javascript knowledge, where can I go for specific help on this ?:D
 
I think that by encoding your URL in this way you'll be safe of the spiders:

<script language="javascript">
url1="http://www.m"
url2="acosx.com/fo"
url3="rums"
</script>

And then to use the url on a link you just do this
<a href="javascript:window.location.href=url1+url2+url3">Trackback</a>

Don't you think it's easier?

Hope it helps
 
Oh yeah I didn't even know you could do that with JS, I really don't know much, that's a great solution and something I can implement through PHP (to make it productive).

I'm still bent on the mouseover thing though, since I don't want it to redirect users, I want them to be able to copy the link by selecting it since clicking a TB link in a browser in WordPress shunts you to the post.

Thanks, very elegant solution.
 
Back
Top