Does Google follow URL's in JavaScript?

A couple of days ago, I was pointed to a blog post on SEOmoz, about the fact that Google had indexed some sites that were only used for AJAX and not linked by normal means, from any website. So I decided to see if I could get a site indexed without linking to it anywhere, but only call it from a JavaScript. I figured the easiest way to see if the page would get indexed was to include a nonsensical word in the URL, something like "octhumbfacp". Then, I created a page, and made sure that I didn't link to it anywhere. Then I added a piece of JavaScript, that loaded the hidden page using an AJAX request, like this:

<script type="text/javascript">

Then, I waited... For about 11 hours! And it was indexed! Go ahead, search google for octhumbfacp. Of course, it was pretty easy for google to find that link, so I decided to try some other techniques, to see how much JavaScript the spiders parses.

I used various variations of that basic JavaScript showed above. The completed JavaScript looked like this (obviously it was enclosed in javascript tags):

try {
} catch (e) {}

Of course, the first link was easy enough to find. The next link would be rather easy to find, by searching through the text with a regular expression like 'String.fromCharCode\(([\d,]+)\)'. The last one, I don't know. Depending on the number of times Google parses things like String.fromCharCode(), the link might be found and it might not.

So, did Google find all three pages? Short answer, no. Long answer, noooo. This means that Google's spiders do parse JavaScript, but not all of it, apparently. Neither Bing or Yahoo has indexed my secret pages. :-)

Written by Jannich Brendle tor 01 april 2010 In SEO

tags: developmentfungoogleSEOtest

Related posts