// 某个页面需要导入的js文件 var href = (location.href||'').replace(location.protocol+'//'+location.host,'').replace(/^([^\.]*)\.?(.*)$/,'$1'); console.log(href); // 首页 if (href.search(/^\/(index|customized|)(\/|$)/)>=0) { $.include('/themes/default/js/index.js'); } // 案例 if (href.search(/^\/(case)(\/|$)/)>=0) { $.include('/themes/default/js/case.js'); } // 会员 操作 if (href.search(/^\/(member)\//)>=0) { $.include('/themes/default/js/member.js'); } // 购物车 jext.im.ly2 = { cart: {}, checkout: {} }; $.include('/themes/default/js/cart/list.js'); if (href.search(/^\/(cart\/checkout)(\/|$)?/)>=0) { $.include('/themes/default/js/cart/checkout.js'); } $.include('/themes/default/js/header.js'); $.include('/themes/default/js/index.js'); $.include('/themes/default/js/join.js'); $(function(){ //留言反馈 $('[feedback-form]').form({ url:$('[feedback-form]').attr('action'), end: function (data) { if(data.ret == 1){ $.alert({ str:data.msg, btn:function(a){ location.reload(); } }); }else{ $.alert(data.msg,{btn:1}); } } }); });