today burst teachers and share the topic of "external" code optimization. What is the main introduction of external code, JavaScript code external optimization how to do, how to do with the CSS code.

1) first to find.

was the first to understand what is the external code. We know that users see the website and the search engine spider is not the same, the user see is from the browser through visual content, so there will be text, pictures, animation, landing and so on. But the search engine spiders were looking at the content behind the original code (HTML), so we hope that these original code more simple for the optimization for the more good, because simple degree directly affect the code search engine crawling efficiency, that is whether the page is spider love, which included.

from the principle of speaking, the code is removed from the external page code to the folder. This folder is in the host on a suitable directory, such as JS we put in the JS directory, CSS directory on style. Then remove the original characters on a page, and in the < head> link rel=; increased < "stylesheet" href= "" type=" text/css "media=" all "/> or scriptlanguage="; < JavaScript "type=" text/javascript "src=" " > < /script>. SRC and href are in the file path to call.

, the head of either CSS or JS code is called for more host request more, it will reduce the speed of opening page. Like this image shows, such as the page 4 JS call +2 CSS calls, each visit this page each calling code will have to load and time, the spider crawl will also encounter this problem. So the code must be combined to call.

well, then specifically talk about how to optimize. The first is the JS code optimization of writing on the page.

Based on the above

is not a kind of code, but at a page in the JS or CSS code written directly into the. This situation has appeared in many websites. This is a kind of situation is bad, because the CSS or JS code inside the characters will be very much. This page will dilute our core content (text), a character spider will also take up, the decrease of efficiency is not it. So CSS or JS code to write directly on the page, we should do the work of external code optimization.