我的機會’不確定的」應用是渺茫的,但我已經通過谷歌嘗試了幾個解決方案,但似乎沒有任何修復「遺漏的類型錯誤:無法調用方法」申請,匿名函數「未定義的」:另一個「遺漏的類型錯誤:無法調用‘
它的工作原理,如果對自己沒有其他的JS,但在同一個頁面的其他腳本的組合,當我得到的錯誤。
它引用的代碼行如下,第32行是罪魁禍首。第32行是這一行 - if (resizeTimeout) { clearTimeout(resizeTimeout); }
:
var $event = $.event, resizeTimeout;
$event.special.smartresize = {
setup: function() {
$(this).bind("resize", $event.special.smartresize.handler);
},
teardown: function() {
$(this).unbind("resize", $event.special.smartresize.handler);
},
handler: function(event, execAsap) {
// Save the context
var context = this,
args = arguments;
// set correct event type
event.type = "smartresize";
if (resizeTimeout) { clearTimeout(resizeTimeout); }
resizeTimeout = setTimeout(function() {
jQuery.event.handle.apply(context, args);
}, execAsap === "execAsap"? 0 : 100);
}
};
好的,歡呼聲。該代碼取自使用v1.8.3的教程。代碼的生存會有什麼好處? – egr103 2013-03-14 16:47:55
@ egr103:我不確定那個方法是幹什麼的,所以我不能提出一個替代方案。教程決定使用不受支持的功能太糟糕了。 – 2013-03-14 16:50:52
我也是。好吧。我甚至刪除了該行,但它不能解決我希望它會修復的問題。 – egr103 2013-03-14 16:57:55