I’ve been experimenting with Google’s treatment of links hidden by javascript. I was all set to report my findings when Blogstorm reported that Google had announced publicly what it was doing. Doh (lesson 1: finish blog posts before going on holiday).
Anyway, here’s an example of what this means in practice, and the result of my test.
MoneySavingExpert.com
MoneySavingExpert.com uses javascript to add functionality to its forum pages.
With JS off, clicking on a user’s name takes you to the login page – you can access the user’s profile only if logged in.
With JS on, if you click on a user’s name, this box opens up – the pink styling shows nofollow links. As you can see, there is a link to the URL that a user has specified as their homepage – in this case, I’ve specified the homepage of this blog for my moneysavingexpert profile.
Recently I spotted these links in my webmaster tools account, and discovered that searching Google for ‘Visit malcolmcoles’s homepage’ returns the homepage of this blog, as well as the MoneySavingExpert forum page.
Of course, this might be happening for reasons other than Google indexing javascript-hidden links, so I decided to test it.
The test
I set up a new MoneySavingExpert profile called Nooby19702009, and I set its homepage as www.digitalsparkle.co.uk/jstest4. I then added a couple of forums posting (one even got a thank you from another user!)
I also added a link to the bottom of every post on this blog. With javascript off, this link used anchor text ‘Coles TEST XYZ’ and linked to www.digitalsparkle.co.uk/jstest3. With javascript on, the URL was changed to www.digitalsparkle.co.uk/jstest4.
If you can make head or tail or it (I just copied it from somewhere), the code was this:
<script>
var hrefLink1 = “http://www.digitalsparkle.co.uk/jstest4.html”
function setHref() {
document.getElementById(‘href1’).href = hrefLink1;}
// alert(document.links(‘href1’).href)
// return hrefLink1}
</script>
The two pages – jstest3 and jstest4 are identical in every way except the URL. They contain a couple of lines of text, including the unique phrase: “colesABCDEF GHIJKL ”
Anyway, the upshot was that the following searches all return jstest4.html and NOT jstest3.html:
- A search for “visit nooby19702009’s homepage” (the javascript-hidden text used on the moneysavingexpert site that pointed to the jstest4 page I’d set as my homepage there).
- A search for “colesABCDEF GHIJKL” (the text used on the jstest3 and jstest 4 pages).
- A search for “coles test xyz” (the anchor text used on this site for both the plain HTML and JS-only links).
This is even though on this site, its jstest3 that is in plain view in the HTML and jstest4 links are all hidden by javascript. And on moneysavingexpert, the link to jstest4 was only visible when the javascript ran. In fact, I can’t get jstest3 to appear in any search I’ve tried. Jstest4 has wiped it out completely.
What this means
This shows two things.
The javascript-hidden link must be passing pagerank. Links from two domains to jstest4 have made google index it rather than the identical jstest3 for the unique phrase (colesABCDEF GHIJKL) that both pages contain.
The javascript-hidden link must be passing anchor text – jstest 4 is a result for “visit nooby19702009’s homepage” – a phrase used only on moneysavingexpert.com in a javascript hidden link.
The implications
The main implication is that if you are relying on javascript to hide links and foil spammers, it won’t work any more …
You might also like
- Guardian hides user profiles from google. An SEO trick?
- Web page word counts: reading vs linking
- Final proof that the Google Adwords keywords tool is useless in the UK
- BT, BTconnect, javascript and accessibility
- MoneySavingExpert adds Twitter sharing button: Twitter goes really mainstream …
Leave a comment!