Javascript & SEO

2019-01-25 14:34发布

问题:

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.

回答1:

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.



回答2:

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

Here's the link Lynx Viewer



回答3:

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.



回答4:

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



回答5:

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.



回答6:

If you're considering developing a full-blown AJAX website, Google says there's a way of making AJAX applications crawlable.

Short answer: there's an agreement between crawler and server on URIs.



回答7:

I would run it through Google's Webmaster tools site, which has a function to view your page as Googlebot. You may be able to determine it's visibility through there.

https://www.google.com/webmasters/tools/home?hl=en



回答8:

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



回答9:

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.



回答10:

Perform a fetch and render within Google's Webmaster tools. Google will tell you in there. Alternatively, use their page speed test tool. Again, it will tell you if your JS is accessible or not.

The easiest way to know, is to simply copy a chunk of text output within the JS within the browser and perform a search in Google.