How HTML increases page loading speed, html increases page loading

Source: Internet
Author: User

How HTML increases page loading speed, html increases page loading

(1) Reduce HTTP requests. (Merge resource files and use image genie;

(2) Place CSS in the header and JavaScript at the end of the body Tag;

(3) define the width and height of the image;

(4) define character sets;

(5) avoid empty src and href attributes,

Write in html as follows: <a href = "javascript:;" class = "triggerName"> Trigger </a>

Js is defined as follows:

$ ("# TriggerName"). click (function (e ){

E. preventDefault (); // cancel the default action of clicking an event to prevent link jump //

})

(6) Enable GZIP compression;

(7) discard CSS expressions and use more efficient CSS selectors;

(8) Use CSS and JavaScript of external links;

(9) code compression for CSS and JavaScript;

(10) reduce re-painting;

 

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.