当前位置:Gxlcms > PHP教程 > ecshopjquery冲突解决方法ecshop介绍ecshop助理ecshop论

ecshopjquery冲突解决方法ecshop介绍ecshop助理ecshop论

时间:2021-07-01 10:21:17 帮助过:4人阅读

1.在 transport.js 文件最后添加下面代码

/* *

* 修正json.prototype信息

*/

function obj2str(o){

// 兼容 jquery

// 先删除 ecshop 的 跟jquery 冲突对象

//delete Object.prototype.toJSONString;

var r = [];

if(typeof o =="string") return "\""+o.replace(/([\'\"\\])/g,"\\$1").replace(/(\n)/g,"\\n").replace(/(\r)/g,"\\r").replace(/(\t)/g,"\\t")+"\"";

if(typeof o =="undefined") return "undefined";

if(typeof o == "object"){

if(o===null) return "null";

else if(!o.sort){

for(var i in o)

r.push("\""+i+"\""+":"+obj2str(o[i]))

r="{"+r.join()+"}"

}else{

for(var i =0;i

r.push(obj2str(o[i]))

r="["+r.join()+"]"

}

return r;

}

return o.toString();

}

ecshop jquery 冲突,ecshop模板,ecshop官网,ecshop教程,ecshop下载,68ecshop,ecshop安装,ecshop插件,ecshop手册,ecshop漏洞,米奇ecshop,ecshop视频,ecshop介绍,ecshop助理,ecshop论

2.在有冲突的页面底部添加

ecshop jquery 冲突,ecshop模板,ecshop官网,ecshop教程,ecshop下载,68ecshop,ecshop安装,ecshop插件,ecshop手册,ecshop漏洞,米奇ecshop,ecshop视频,ecshop介绍,ecshop助理,ecshop论

3.在用有冲突的页面中查找Ajax.call('flow.php?step=add_to_cart', 'goods=' + goods.toJSONString(), collect_to_flow_response, 'POST', 'JSON');

替换成:Ajax.call('flow.php?step=add_to_cart', 'goods=' + obj2str(goods), collect_to_flow_response, 'POST', 'JSON');

ecshop jquery 冲突,ecshop模板,ecshop官网,ecshop教程,ecshop下载,68ecshop,ecshop安装,ecshop插件,ecshop手册,ecshop漏洞,米奇ecshop,ecshop视频,ecshop介绍,ecshop助理,ecshop论

以上就介绍了ecshop jquery 冲突解决方法,包括了ecshop,jQuery方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

人气教程排行