Googlebot doesn't see jquery generated content

后端 未结 3 1131
余生分开走
余生分开走 2021-01-01 18:46

I use jQuery to retrieve content from the database with a json request. It then replaces a wildcard in the HTML (like %title%) with the actual content. This works great and

3条回答
  •  盖世英雄少女心
    2021-01-01 19:23

    Googlebot obviously doesn't render the page that it downloads. This will probably be the same behavior that other search bots employ as well.

    You need to use a server side scripting or compilation solution (there are plenty to choose from, including PHP, ASP.NET, etc). This way you still keep your dynamic and i18n features and Googlebot sees your page the way you intended. Or at least do this for fundamental page attributes like the Title that you know Googlebot is evaluating, and keep the jQuery updating for not so important parts of the page.

    (To be honest though, using jQuery to replace tokens after the page has downloaded is probably not the most efficient way to do things, especially when server side scripting is so easy and free).

提交回复
热议问题