Research on AJAX technology and search engine optimization

Source: Internet
Author: User

Recently, many of the old students in Shuo-asp.net asked me: "In the development of the Web site, how to let the Ajax page to be included in the search engine?" ”
As we all know, in Ajax all onclick action direct contact Hair JavaScript events, the data displayed on the page may not appear in the HTML, so the search engine is difficult to know the specific content of your page, it can not be truly included.
Now, I would like to introduce you to a simple way, so that you can use Ajax while also taking into account the search engine's "feelings."

-------------a traditional Ajax solution. htm-------------
<script>
function Orz6 ()
{
document.getElementById ("orz6.com"). innerhtml= "Hello everyone, Welcome to http://www.orz6.net!" (If the article is relatively long, omit 2000 words here) ";
}
</script>
<a href= "#" _fcksavedurl= "" # "" onclick= "Orz6 ()" > traditional characters, Martian text </a>
<div id= "orz6.com" ></div>
Code Analysis: From the above code, you can see that the point of href is "#", so the search engine is unable to crawl to the specific content of the article.

-------------take into account the search engine scheme. htm-------------
<script>
function Orz6 ()
{
document.getElementById ("orz6.com"). innerhtml= "Hello everyone, Welcome to http://www.socut.com!" (If the article is relatively long, omit 2000 words here) ";
}
</script>
<a href="http://www.orz6.com/fantizi.aspx" onclick= "orz6 (); return false;" > traditional characters, Martian text </a>
<div id= "orz6.com" ></div>

Code Analysis: After my improvement, href directly points to an existing page, mainly to use the specific content of the display article. Of course, this page we have to specifically do out, mainly to facilitate the search engine collection. If you are careful, you will find that the OnClick event is followed by a return of false, so that the user prevents page conversion when using AJAX features.

The research concludes that the use of the second scheme can not only fully play the charm of Ajax, but also can completely take into account the search engine crawl, as far as possible to avoid the loss of visitors.

(Reprint Please specify: Shuo empty strong master)

</

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.