Ajax 搜索引擎优化技术
我读过一些关于使谷歌能够抓取基于 ajax 的网站的主题,但这些信息颇有争议。是否可以?如果是的话,有人可以发布教程链接吗?
我最常按以下方式使用 ajax 和 jquery:
- 我有一个 div
- 我将请求发送到生成 html 的 php 后端
- 当响应到达时,我使用得到的响应设置 div 的内部 html
这是一个好方法吗为了让页面seo优化?
谢谢
I've read some topics regarding enabling google to crawl ajax based sites but the information is quite controvesrial. Is it possible? If yes can someone post a link to a tutorial please?
I most often use ajax with jquery in the following way:
- I have a div
- I send request to a php backend where the html is generated
- When the response arrives i set the inner html of the div with the response i got
Is that a good approach in order to make the page seo optimized?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
在我的网站中,我使用普通的 php 页面,如果通过 Ajax 请求,则不包含页眉和页脚,它只是检索内容(正文)并包含它。
如果从数据库检索内容,您可以创建一个检索内容的普通页面和一个专门用于 Ajax 的程序。
试想一下,如果您停用 Javascript,您的网站将继续运行。
In my website, I use a normal php page and if its requesting by Ajax, its don't include the header and the footer, its just retrieve the content (body) and include it.
If the content is retrieved from a database, you can create a normal page who retrieve the content and a program just for Ajax.
Just think if you deactivate Javascript, your site continue to work.
您可能不习惯使用 AJAX SEO https://github.com/laukstein/ajax-seo
You might wont to use AJAX SEO https://github.com/laukstein/ajax-seo
看一下这个链接:http://code.google.com/web/ajaxcrawling/
Google 有关于如何向其抓取工具公开您的内容的指南。
另外,SO 上的这个问题也谈到了同样的事情:Facebook 和新 Twitter URL 中的 shebang/hashbang (#!) 是做什么用的?
Have a look at this link : http://code.google.com/web/ajaxcrawling/
Google has guidelines on how to expose your content to its crawler.
Also, this question on SO talked about the same thing : What's the shebang/hashbang (#!) in Facebook and new Twitter URLs for?
我更喜欢采用渐进增强设计策略,其中网站采用非常简单的标记设计,搜索引擎可以抓取,然后在上面添加 AJAX 以提高用户体验。这通常使用 JavaScript 来“劫持”链接和表单来覆盖默认行为并用 AJAX 请求替换它。
I prefer taking a progressive enhancement design strategy in which the website is designed in very simple markup that the search engines can crawl and then adding AJAX on top for user experience. This typically employs "hijacking" links and forms with Javascript to override the default behavior and replace it with AJAX requests.
您可以将网站设计为无需 JavaScript 即可完全访问,然后使用 AJAX 加速您想要的操作。
You can design the Website to be fully accessible without JavaScript and after that speed up the things you want with AJAX on top of it.