2018.6.29
' } }, jump: function(url) { $.tb.location.setHref(url); }, searchEvent: function() { var self = this; var $container = $("#search-form"); $container.on("click", ".j_login_tb", function(e) { e.preventDefault(); var param = $container.find(".search-input").val(); self.jump(self.config.loginTBUrl + param); }); $container.on("click", ".tb-logo", function() { self.jump(self.config.homePage); }); }, judgeErrorType: function() { var self = this; $.get("/errorpage/deledErrorInfo?tid=" + $.tb.location.getHref().match(/kz=\d*|\/p\/\d*/).toString().slice(3)).done(function(res) { if (res.no == 0 && res.data != null) { $("#errorText").html(self.config.errorText[res.data.type.toString()]); } else { $("#errorText").html(self.config.errorText['0']); } }) }, judgetIframe: function() { var self = this; $.get("/errorpage/getGoodThread").done(function(res) { if (/class=\"page_404_iframe\"/.test(res)) { $("#error_404_iframe").tbattr("src", self.config.iframeSrc); } }).fail(function(res) { }).always(function(res) { }); }, trackData: function() { var $page404 = $("body.page404"); $.stats.track('404页面', '404项目回收站', null, 'view'); $page404.on("click", ".hsz-tag", function(e) { $.stats.track('404页面', '404项目回收站', null, 'click'); }); $page404.on("click", ".tbsy-tag", function(e) { $.stats.track('404页面', '404返回首页', null, 'click'); }); }, init: function() { var hit_anti_ctrl = 2; if (hit_anti_ctrl === 1 || hit_anti_ctrl === 2) { return; } this.judgetIframe(); this.searchEvent(); this.judgeErrorType(); this.trackData(); } }; $(function() { TB404.init(); });