File size: 973 Bytes
b3787d8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | 'use strict'
var basePath='http://127.0.0.1:8080/htmltemplate/'; //tomcat
$(function(){
//项目主类用来引入其他公用脚本
});
var mainjs=new Object({
initFileList: function(){
console.log('-------------start mainjs script load-----------------');
//以下ajax可以复制多个来引入公用js
//方案1
//$.getScript( basePath+'js/lib/toastr/toastr.min.js');
//方案2
$.ajax({
type:'post',//加载方式post
async: false,//使用同步的方式,true为异步方式
//crossDomain: true,//跨域支持 本地运行时需要解开
cache:false, //缓存
url : basePath+'js/lib/toastr/toastr.min.js',//载入脚本路径 正式时需加basePath
dataType: 'script',
scriptCharset:'utf-8'
});
console.log('-------------end mainjs script load-----------------');
}
});
//不要移动这句位置
mainjs.initFileList();
|