AJAX and getting it to play nice with search engines seems to be a common problem faced when developing modern web sites.
The problem lies in the fact the content fetched via AJAX in a page, is not "seen" by search engines.
This may very well result in you removing AJAX from areas of pages where it is critical that search engines are able to parse the content.
As an example:
You have a page on your site that allows the user to search and filter through all available products, this being the main way for users to find products on your site. The results, consisting of an image, a basic description and a link to that product's page, are returned to the end-user via AJAX.
The solution
The solution that probably comes to mind is to simply remove the AJAX at the sacrifice of improved functionality.
There is however a solution that allows you to retain the AJAX and keep the SEO.
Its a best practice that doesn't get implemented enough, and that is to ensure your pages gracefully degrade, functioning correctly when javascript is disabled. Once you've got this right, then add the javascript and AJAX in.
A common example is javascript executed when clicking a link. One of the solutions suggested (known as Hijax) to this problem is quite simple:
<a href=”ajax.htm?foo=32” onClick=”navigate('ajax.html#foo=32'); return false”>foo 32</a>
If the user has javascript disabled, he will be redirected as per normal link behaviour, where if he has javascript enabled, the onclick javascript will be executed. For simplicity I used the onclick attribute as opposed to the unobtrusive approach.
Conclusion
Depending how far you are into your site development, making it degrade can be quite challenging. Ensuring your site can degrade from the beginning is relatively trivial, so its best to start early. Your site will be more accessible, to both users and search engines, while allowing you to add in AJAX functionality that won't affect your sites SEO.

No comments:
Post a Comment