Website accelerated graphics and text tutorial one: Let js file load faster

Source: Internet
Author: User
Keywords Website acceleration

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

Many sites will add a lot of JS code, which is the statistics Ah, advertising code, such as a large number of JS code, such as the use of a XX alliance most of the time to open the Web page when the ads are displayed in the load of the alliance, which seriously affected the user's experience. Is there any way to speed up the loading of JS? Below the cheap bar on the introduction let JS file loading speed of the graphics and text tutorial.

First, most of the JS calling code is:

<script src= "Xxxx.js" ></script>

Just change the code to the following code to speed up loading

<script type= "Text/javascript" >


document.write ("<SCR" + "IPT src=\" xxxx.js\ "></sc" + "ript>")


</script>

The effect is the same.

Below to take a cheap bar for example, such as call Ads JS code as follows:



Just change it to the following code:

<script type= "Text/javascript" >


document.write ("<SCR" + "IPT src=\" http://www.5558.biz/plus/ad_js.php?aid=17\ "language=\" JavaScript\ "></" SC "+" ript> ")


</script>\

Insert the above code into the page where you want to put the ad.

Much faster.

Other JS can also be the same, advertising, page effects can be.

Original link: http://www.5558.biz/a/jianzhanjishu/tuwenjiaocheng/JS-Speed.html reprint please keep, thank you

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.