How to
SEO advice
Categories: How to, Internet. Tags: , , ,

Proof and implications of javascript passing anchor text and page rank in Google

June 2, 2009 No Comment

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.

The box hidden by javascript on

The box hidden by javascript on 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 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 With javascript on, the URL was changed to

If you can make head or tail or it (I just copied it from somewhere), the code was this:

var hrefLink1 = ""
function setHref() {
document.getElementById('href1').href = hrefLink1;}
// alert(document.links('href1').href)
// return hrefLink1}

Search reslts for "visit nooby19702009's homepage"

Search results for "visit nooby19702009's homepage"

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 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
  1. Guardian hides user profiles from google. An SEO trick?
  2. Web page word counts: reading vs linking
  3. Final proof that the Google Adwords keywords tool is useless in the UK
  4. BT, BTconnect, javascript and accessibility
  5. MoneySavingExpert adds Twitter sharing button: Twitter goes really mainstream …

Share this post

Follow me on Facebook or Twitter

Leave a comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.