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">
  jQuery.get("http://bredsaal.dk/secret-octhumbfacp-page.html");
</script>

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 {
  jQuery.get("http://bredsaal.dk/secret-octhumbfacp-page.html");
  jQuery.get(String.fromCharCode(104,116,116,112,58,47,47,98,114,101,100,115,97,97,108,46,100,107,47,115,101,99,114,101,116,45,119,117,103,103,105,100,105,119,97,103,103,101,100,105,45,112,97,103,101,46,104,116,109,108));
  eval(String.fromCharCode(106,81,117,101,114,121,46,103,101,116,40,34,104,116,116,112,58,47,47,98,114,101,100,115,97,97,108,46,100,107,47,115,101,99,114,101,116,45,102,108,105,112,112,101,100,105,102,108,111,112,112,101,100,121,45,112,97,103,101,46,104,116,109,108,34,41,59));
} 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

social