/*基本配置*/ /************************ Ajax封装 ***************************/ $(function () { jQuery.support.cors = true; //var apiHost = "http://192.168.16.14:8041/API/Client/"; var apiHost = ""; jQuery.zmdAjax = function (api, method, data, async, successfn, errorfn, dataType) { method = (method == null || typeof (method) == "undefined") ? "post" : method; data = (data == null || data == "" || typeof (data) == "undefined") ? { "date": new Date().getTime() } : data; async = (async == null || typeof (async) == "undefined") ? true : async; dataType = (dataType == null || dataType == "" || typeof (dataType) == "undefined") ? "json" : dataType; $.ajax({ url: '/'+api, type: method, data: data, async: async, dataType: dataType, cache: false, contentType: "application/x-www-form-urlencoded; charset=UTF-8", success: function (result) { successfn(result) }, error: function (e) { console.log(e); } }); }; }); //获取内容页banner function getPageBannerImg(positionid) { // $.zmdAjax("BannerList", "POST", { LanguageType: LanguageId, AdPositionId: positionid }, false, function (obj) { // if (obj.code == 0) { // if (obj.count > 0) { // $(".con_img_box").attr("style", "background:url(" + obj.data[0].BigAdImage + ") no-repeat center center;background-size:cover;"); // } // } // else { // getErrorMsg(obj.msg);//错误提示 // } // }, function (obj) { // getErrorMsg(obj.msg);//错误提示 // }); } //分页 function getPagerBtn(lan) { if(lan=='en'){ $(".link_more_btn").addClass("hover").attr("onclick", "BindNext()").text("Click to load more"); }else{ $(".link_more_btn").addClass("hover").attr("onclick", "BindNext()").text("点击加载更多"); } } //暂无数据 function getPagerMsg(lan) { if(lan=='en'){ $(".link_more_btn").text("— More about this when more information is forthcoming. Stay tuned! —").removeAttr("onclick").removeClass("hover"); }else{ $(".link_more_btn").text("— 更多精彩内容即将上线,敬请关注 ! —").removeAttr("onclick").removeClass("hover"); } } //错误提示 function getErrorMsg(message) { layer_box("温馨提示", message); } function getPagerBtn2(el, fu) { el.addClass("hover").attr("onclick", fu).text("点击加载更多"); } //暂无数据 function getPagerMsg2(el) { el.text("— 更多精彩内容即将上线,敬请关注 ! —").removeAttr("onclick").removeClass("hover"); }