You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
|
|
|
|
|
//中华游JS脚本函数 by SHW
|
|
|
|
|
|
|
|
|
|
//======缓加载======
|
|
|
|
|
//例:getDom("login:index/Login,adsPic:ad1")
|
|
|
|
|
//带条件例子:getDom("login:index/Login,adsPic:ad1(act=xxx)")
|
|
|
|
|
function getDom(domStr){
|
|
|
|
|
var thisData=domStr.replaceAll(",","&");
|
|
|
|
|
var thisData=thisData.replaceAll(":","=");
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "POST",
|
|
|
|
|
cache: true, //缓存数据
|
|
|
|
|
async: false,//锁定前端
|
|
|
|
|
url: "/load.asp",
|
|
|
|
|
data: thisData,
|
|
|
|
|
success: function(data){
|
|
|
|
|
//考虑到json格式asp存在比较多的问题,暂用分割形式。待改造。
|
|
|
|
|
data=data.split("$%^%$");
|
|
|
|
|
for(getDom_i=0;getDom_i<data.length-1;getDom_i++){
|
|
|
|
|
var domData=data[getDom_i].split("#$%$#");
|
|
|
|
|
var domName=domData[0];
|
|
|
|
|
var domHtml=domData[1];
|
|
|
|
|
$("#"+domName).html(domHtml);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//======replaceAll======
|
|
|
|
|
String.prototype.replaceAll=function(s1,s2){return this.replace(new RegExp(s1,"gm"),s2);}
|