Possible Duplicate:
Does the Google spider render JavaScript?
This a SEO related question, not a code related one.
Googles own link cleaning / cloaking
Gå to http://www.google.com and search for something.
- Hover the title and you will se a link to the page you want to go to.
- The URL you see when hovering is NOT the link you are clicking on.
- Instead of clicking you can drag the title a little bit and then hover it. Then you will se the real URL.
My own link cleaning / cloaking
- Go to http://jsfiddle.net/NvmER/1/ and click the link, or look at the code below.
- You will be "redirected" to http://www.test.com.
- The real link are http://www.test.com/?event=23
Working code in case jsfiddle don't work
If you need to se how it works I pasted a code below.
<a class="direct" href="http://www.test.com/?event=23" data-redirect="http://www.test.com">Länk</a>
$(document).ready(function() {
$("a.direct").live("mousedown", function(e){
var oldurl = $(this).attr('href');
var newurl = $(this).attr('data-redirect');
$(this).attr('href', newurl);
});
});
Question
Is this ok with Google? It's done with javascript.
If you have an answer, link to a source or test to support it.
location.href
, overriding the default action? What is the intention of doing this?