3
我正在嘗試使用Modernizr.js創建一個檢測Mutation Observers的測試。在Modernizer文檔中,there's a section for testing DOM elements稱爲前綴。我試過用:如何用Modernizr.js測試DOM4突變觀察者?
Modernizr.load({
test: Modernizr.prefixed('MutationObserver', window),
yep: ['/js/polyfill_yep.js'],
nope: ['/js/polyfill_nope.js']
});
但很明顯,這是行不通的。我得到一個TypeError: f.bind is not a function
我很確定前綴字符串不是MutationObserver,但我不知道它會是什麼,或者即使我正確地編寫測試。有任何想法嗎?
可以運行開發版本,讓你可以更具體的錯誤? – Esailija