Home > Web Front-end > JS Tutorial > javascript synchronous Import, synchronous method of calling external js_javascript skills

javascript synchronous Import, synchronous method of calling external js_javascript skills

WBOY
Release: 2016-05-16 19:03:01
Original
1819 people have browsed it

Online demo address http://www.jb51.net/jslib/Import/a.html

Main function code import.js

Copy code The code is as follows:




Remote test a.js




Copy code


The code is as follows:

var a = "Script Home www.jb51.net===";
Specific calling codeCopy code

The code is as follows:

 
 
- 
 
 
 
 
(function(){ 
    function callback() 
    { 
        var IsIE = (navigator.userAgent.indexOf("MSIE") == -1)? false : true; 
        if (IsIE) 
        { 
            if(/loaded/.test(this.readyState)) 
            { 
                alert(a); 
            } 
        } 
        else 
        { 
            alert(a); 
        } 
    } 

    _Import("http://www.jb51.net/jslib/Import/a.js", callback) 
})() 
 

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