How to better use JavaScript in SEO optimization

Source: Internet
Author: User

Intermediary transaction ">seo diagnose Taobao guest cloud host technology Hall

Today, JavaScript, which is widely used in client-based languages, greatly enhances the interactivity of Web sites, enabling them to contain more active elements and more exciting content. Unfortunately, however, search engines do not recognize their content. Google's Webmaster Guide clearly states that "if complex features such as Javascript, cookies, session IDs, frames, DHTML, or Flash cause you to not see the entire site in a text browser, Search engine information acquisition software may encounter problems when crawling your site.


The JavaScript code in the Web page is too much, it is more difficult to crawl and analyze the content of the Web page, here we discuss how to use JavaScript better in the page.


1, must not in the website navigation bar, contains the keyword anchor text link uses the JavaScript, this will affect the keyword density, more importantly is the search engine cannot crawl its link content.

2, try to avoid using the () method, () method to open a new window, such as the return of the page, in the page only use this method will bring a lot of convenience, but, () Link can not be identified by the search engine, Therefore, in addition to the user-based scenario, try to avoid using this method.


1, try to avoid the use of JavaScript Web page content, if the content contains some keywords, will seriously affect the keyword density.

2, JavaScript in the document.write () method is often used to output HTML text, the search engine is also unable to better identify. Therefore, try to avoid using the document.write () method to output the content.

Location: JavaScript calls are divided into internal and external calls, as the name implies, the internal call is JavaScript content in the interior of the page, the external call is the JavaScript code in a JavaScript file, through the <script Language= "JavaScript" src= "*.js" ></script> this way call.

1. Internal call:

Try not to put JavaScript content on the head of the page, which will affect the page's important content can not be the first search engine crawl. It is best to put it at the bottom of the page, so that both the search engine friendly, the load on the page, display speed also improved.

2. External call:

If the situation permits, place the JavaScript content in a JavaScript file and call it through <script language= "javascript" src= "*.js". In this way, the page in addition to a large number of JavaScript code, reduce the size of the page, improve the loading of the page, display speed, search engine more friendly.

At present, Google has been able to identify some simple JavaScript code, and does not promise to crawl JavaScript. Therefore, it is necessary to reduce the unfriendly performance of JavaScript to the search engine, while ensuring the interactive and dynamic effects of the pages.

This article for Second-hand production net original, A5 first! Welcome to reprint, please respect the author, indicate the source, thank you! SEO Exchange Group: 121029844

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