开发者

Google crawling, AJAX and HTML5

开发者 https://www.devze.com 2023-04-09 08:20 出处:网络
HTML5 allows us to update the current URL without refreshing the browser. I\'ve created a small framework on top of HTML5 which allows me to leverage this transparently, so I can do all requests using

HTML5 allows us to update the current URL without refreshing the browser. I've created a small framework on top of HTML5 which allows me to leverage this transparently, so I can do all requests using AJAX while still having bookmarkable URLs without hashtags. So e.g. my navigation looks like this:

<ul>
   <li><a href="/home">Home</a></li>
   <li><a href="/news">News</a></li>
   <li>...</li>
</ul>

When a user clicks on the N开发者_Go百科ews link, my framework in fact issues an AJAX GET request (jQuery) for the page and replaces the current content with the retrieved content. After that, the current URL is updated using HTML5's pushState(). However, it is still equally possible to just type http://www.example.com/news in the browser, in which case the content will be provided synchronously of course.

The question now is, will Google crawl the pages for this site? I know that Google provides a guide for crawling Ajax applications, but the article supposes that hashtags are used for bookmarkability, and I don't (want to) use hashtags.


Since you have actual hard links to the pages and they load the same content, Google will crawl your site just fine.

0

精彩评论

暂无评论...
验证码 换一张
取 消