动态引用脚本
在页面中引用一脚本文件是件很容易的事,但如果是一个庞大的脚本系统,又想做到用多少取多少,就不是件容易的事了,对此,我想了一个办法,实现动态引用脚本,但也还不是非常的智能。
 
  document._ref = function ( src ){
document._ref = function ( src ){  document.write( '<script language="JScript" src="' );
        document.write( '<script language="JScript" src="' );  document.write( window.APQ );
        document.write( window.APQ );  document.write( src );
        document.write( src );  document.write( '.js"></\script>' );
        document.write( '.js"></\script>' );  };
    }; 该脚本的使用方式示例如下:
 window.APQ = location.protocol + "//" + location.hostname + "/Apq/";
window.APQ = location.protocol + "//" + location.hostname + "/Apq/";
 if( !document._ref )
if( !document._ref ) {
{ document.write( '<script language="JScript" src="' );
 document.write( '<script language="JScript" src="' ); document.write( window.APQ );
 document.write( window.APQ ); document.write( "_system" );
 document.write( "_system" ); document.write( '.js"></\script>' );
 document.write( '.js"></\script>' ); }
}
 
                     
                    
                 
                    
                

 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号