Last week we set up an experiment to see what kind of Javascript-generated content Google would index.

We created a test page with three kinds of content:

  1. Content loaded by simple inline javascript using document.write().
  2. Content loaded automatically through an Ajax call.
  3. Content loaded through an Ajax call in response to user action.

Our findings are as follows:

1. Inline Javascript  using document.write(): YES – Google can (and does) find and index this content.

2 & 3. Content loaded through Ajax: NO – Google does not index this content.


Content that is written to your document using Javascript’s document.write function will be indexed by Google.

But content that is loaded asynchronously, for example via an Ajax call, is not indexed.

If you have important content that you need to get the search engines to find, don’t use Ajax – or at least don’t rely on Ajax alone. If you’re going to use Ajax in your website or application, Google provides some guidelines for getting your Ajax content crawled.