Home > Web Front-end > JS Tutorial > Asynchronously dynamically load JS and run (sample code)_javascript skills

Asynchronously dynamically load JS and run (sample code)_javascript skills

WBOY
Release: 2016-05-16 17:09:19
Original
1077 people have browsed it

As shown below:

Copy the codeThe code is as follows:

(function(){
var ga=document.createElement('script');ga.type?=?'text/javascript';?ga.async?=?true;
ga.src?=?('https:' ?==?document.location.protocol???'https://ssl'?:?'http://www')? ?'.google-analytics.com/ga.js';
var? s?=?document.getElementsByTagName('script')[0];?
s.parentNode.insertBefore(ga,?s);

})();

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template