Nowadays, more and more sites are developed using ajax because of its interactivity, ease of use, and speed.
Although it has obvious advantages there are some drawbacks:
- Ajax pages don’t register themselves in browser history, so the back button become useless
- Because the url remains the same through different requests, the bookmarking doesn’t work as expected
- The same origin policy prevents Ajax to make requests across domains
- Content retrieved with ajax is not accessible to non-javascript browsers, or web crawlers, making the ajax pages not indexable by search engines.
Today i will talk about how can you overcome the problem of the content not available to search engines and users with javascript disabled:
You need to generate the same content to the search engine as you do for the regular user, just presented in a different way.
So if you have a link
<a onClick="showAjaxContent('about');return false;" href="about.php">About</a>
where showAjaxContent() is used to load some ajax content in a <div> box, you can just create a page to display the page, as if it was loaded directly from the browser (using headers, footers and all other elements from your page).
No related posts.