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

javascript synchronous Import, synchronous method of calling external js_javascript skills

WBOY
WBOYOriginal
2016-05-16 19:03:011780browse

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) 
})() 
 

Statement:
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