Research on Ajax technology and Search Engine Optimization

Source: Internet
Author: User

Recently, many old students who have made some achievements in NLP blank course asked me: "in ASP. Net website development, how can I include Ajax pages in search engines ?"
As we all know, all onClick actions in AJAX directly trigger javascript events, and the data displayed on the page may not appear in HTML at all, so it is difficult for search engines to know the specific content of your page, in this case, the data cannot be actually indexed.
Now, I will introduce you to a simple method, so that you can take into account the "feelings" of search engines while using AJAX ".

------------- Traditional ajax .htm -------------
<Html>
<Head>
<Script>
Function orz6 ()
{
Document. getElementById ("orz6.com"). innerHTML = "Hello, welcome to http://www.orz6.net! (Assuming the article is long, 2000 words are omitted here )";
}
</Script>
</Head>
<A href = "#" _ fcksavedurl = "" # "" onClick = "orz6 ()"> traditional Chinese text, Mars </a>
<Div id = "orz6.com"> </div>
</Html>
Code Analysis: From the code above, we can see that href points to "#", so that the search engine cannot capture the specific content of the article.

------------- Search engine solutions. htm -------------
<Html>
<Head>
<Script>
Function orz6 ()
{
Document. getElementById ("orz6.com"). innerHTML = "Hello, welcome to http://www.socut.com! (Assuming the article is long, 2000 words are omitted here )";
}
</Script>
</Head>
<A href = "http://www.orz6.com/fantizi.aspx" onClick = "orz6 (); return false;"> traditional Chinese text, Mars </a>
<Div id = "orz6.com"> </div>
</Html>

Code Analysis: After my improvements, href points directly to an existing page, mainly to display the specific content of the article. Of course, we need to make this page specifically to facilitate search engine indexing. If you are careful, you will find that a return false statement is added after the onClick event to prevent page conversion when using AJAX.

The study concludes that the second solution can not only give full play to the charm of Ajax, but also take into account the crawling of search engines to avoid visitor loss as much as possible.

(For details, refer to:)
 

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.