views:

289

answers:

7
+3  Q: 

Javascript & SEO

How can I tell if a google bot is reading my javascript generated content?

I have an AJAX script that generates some text dynamically on a page... this content does not change by user, but simply by date/time.

I am not sure how I can tell if google sees it.

+2  A: 

I don't think it will. If you want it to be always read by Google, try generating some default text server side by the date time, and overwriting that with js.

alex
+2  A: 

It doesn't. As far as I know, Google does not yet support JavaScript (or, in fact, any form of dynamic content).

musicfreak
+3  A: 

Search engine bots don't have javascript, so they won't see any content that was dynamically added to your page via AJAX, etc. In your browser options, turn off Javascript and reload your website. All that they'll see is the content and the links there.

The solution: on your page, in the plain HTML place a link to a page which shows the rest of your content (the stuff that you would load via AJAX), then have Javascript replace that link with the content. The search engine bots will see the link and follow it, indexing all your content. Just make sure that on these lo-fi pages, you provide links back to the regular page, since that's what Google will link to.

nickf
Interestingly, Google seems to read content added via document.write()...
J-P
That is strange. Who uses document.write anyway, though?
nickf
But - if you link to something that has content for purely this reason, then it may be indexed by Google and depending on what it is - may look strange if someone clicks directly on it from a search results page (I hope that makes sense).
alex
yeah I know what you mean - that's what I was trying to say in that last sentence. You could always put a Javascript redirect on those pages. ;)
nickf
+1  A: 

JavaScript generated content is not indexed by search engines. See this question for more info.

Dmytrii Nagirniak
+2  A: 

Download Lynx and access your site. if you can see your content, google can too!

Here's the link Lynx Viewer

Moak
+1  A: 

Important content, whether it be needed for SEO, accessibility or both, should be available to users (or in this case, bots) without JS. Although, recently I read this little blog post which says that Google bot has JS.

dylanfm
Read the first comment on that blog post: that is much nearer the mark than the suggestion that Googlebot executes scripts in the general case.
NickFitz
Ah thanks. I should've paid more attention :)
dylanfm
A: 

No I dont think they read dynamic content generated using javascript. What you see as view source of a page is generally what a google bot will read. Or you can say what you see in Lynx.

moha297