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:)