Solve the Problem of jquery easyui easyloader loading external js files
When easyloader loads an external js file, although the callback function is successfully called, The js file cannot be loaded. The solution is as follows:
Find the easyload. js file and open the following position: change the script to this in red;
Var _ 8 = document. createElement ("script ");
_ 8. type = "text/javascript ";
_ 8. language = "javascript ";
_ 8.src= _ 5;
_ 8. onload = _ 8. onreadystatechange = function (){
If (! _ 7 &&(! This. readyState | this. readyState = "loaded" | this. readyState = "complete ")){
_ 7 = true;
This. onload = this. onreadystatechange = null;
If (_ 6 ){
_ 6. call (_ 8 );
}
}
};
In addition, you must note that the external js file to be loaded must end with. js, otherwise it will not be loaded.
// Customize the js Module
Method 1:
Easyloader. modules = $. extend ({},{
"BaseUI ":{
Js: '<% = basePath %> struts/baseui. js', css:' <% = basePath %>/struts/themes/default/easyui.css '}
}, Easyloader. modules );
Easyloader. locale = "zh_CN ";
Easyloader. load (['layout ', 'tabs', 'messager', 'portal ', 'baseuis'], function (){
Alert ("OK ");
});
Method 2:
Using ("<% = basePath %> struts/baseui. js", function (){
Alert ("OK ");
});