开发者

Is AJAX Really SEO Friendly?

开发者 https://www.devze.com 2023-02-05 02:14 出处:网络
Now with Web 2.0, the trend is AJAX, there are开发者_如何学C many existing frameworks on the market promoting AJAX, but is AJAX really SEO friendly?Yes, it is a lot harder to make a search-engine-frie

Now with Web 2.0, the trend is AJAX, there are开发者_如何学C many existing frameworks on the market promoting AJAX, but is AJAX really SEO friendly?


Yes, it is a lot harder to make a search-engine-friendly AJAX site. It's probably worth the effort to make your website work to a base level without Javascript for the sake of search engine crawlers alone.

No, it is not impossible for a search engine to crawl your AJAX site (so long as that search engine is Google). You just need to give it a bit of a helping hand: see Making AJAX Applications Crawlable on Google's support pages.


Note: this answer is now very much outdated. Google still provide good advice for how to deal with this -- and it's easier than it was.


No, Ajax is incredibly SEO-unfriendly, as spiders, etc. don't execute any of the Ajax calls.

However, Ajax should really only be used as a means of improving the user experience - there should always be a base level of functionality for SEO and (more importantly IMHO) in case the end user doesn't have JavaScript enabled.

In other words, if the user can make use of Ajax by all means use it to improve their experience, but they should still be able to fully use the web site without JavaScript. (It's all about "graceful degradation" and all that.)


Remember to put href params in [a] tags pointing to similar server side functionality. This way the content can be indexed by bots.

This article might be usefull:

http://www.singlegrain.com/blog/creating-an-seo-friendly-site-using-ajax


Simplified AJAX solutions are horrible for SEO. Always keep in mind that spiders, etc., will ignore javascript and CSS (View a page with these disabled to simulate it).

What you can do though, if something triggers AJAX content, have it also be a normal link to a page. E.G., if you use something like:

<a href="my/resource" target="ajax_panel_name">Load AJAX</a>

And then wrap that with Javascript functionality, make sure the link itself takes you to the proper resource. You can setup the resource to display a full page if it is a normal link or just display the AJAX content if it is an XHR request.

The following code (in PHP) shows how you can detect if a request is HTML or XHR (request parameter is available in at least IE8, FF3, Safari, Opera, Chrome):

<?php
function xhr_request() {
    if (strpos($_SERVER['HTTP_ACCEPT'], 'text/javascript') !== FALSE) {
        return TRUE;
    }
    return FALSE;
}
?>


It can be if used correctly.

There are two main SEO issues with AJAX if done incorrectly:

  • content cannot be found
  • links cannot be found

Another small issue is the loss of keyword focus.

An overview on doing it right is found there: http://www.internetmarketinginc.com/blog/making-ajax-seo-friendly/

The main problem of AJAX not being SEO friendly is the nature of JavaScript which is client-side. The browser runs it and not the server. But if the data is served also server-side, then there is no problem for Google to see that.

The main key here is making AJAX degrade gracefully. Meaning even if JavaScript is off, everything will still work, it may not work in the same manner, but still it works and the content is still there. If content always uses document.write and innerHTML, then most probably you will have an SEO issue.


Yes, AJAX can be SEO friendly and Single Page Interface (AJAX intensive) applications can also work with JavaScript disabled (SEO compatible).

Take a look to this demo.

0

精彩评论

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

关注公众号