Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can search engine spiders see content I add using jQuery?

Tags:

I currently have something like this

<p class="test"></p>  <script type="text/javascript">     $(document).ready(function() {           $(".test").html("hey");     }); </script> 

Will search engines be able to spider the "hey" text? and if yes, what method can I use to prevent that.

like image 916
Matthew Hui Avatar asked Jul 05 '11 18:07

Matthew Hui


1 Answers

Despite what is being stated here in other answers and totally contrary to Google's own FAQ, a Google employee named JohnMu answered a question recently in Google Groups about how the GoogleBot came to follow a non-existent URL. (The actual URL was contained within the jQuery code itself and the GoogleBot DID try to follow it.)

jQuery causing 404 errors in Google Webmaster Tools

Google Employee explains how JavaScript and jQuery are indexed

Apparently, Google does attempt to index your JavaScript.

Quote Google's JohnMu:

"I would also recommend not explicitly disallowing crawling of the jQuery file. While we generally wouldn't index it on its own, we may need to access it to generate good Instant Previews for your site."

JohnMu later in the same thread...

"Additionally, we're constantly working on improving processing of JavaScript for web-search in general, so if you use jQuery to pull in content, and the jQuery script is disallowed for Googlebot, then we would not be able to look at that at all."

like image 106
Sparky Avatar answered Nov 01 '22 21:11

Sparky