1
我试图创造出的情况下将使用的浏览器不支持班级名册定制element.prototype功能未定义“这个”
if(!Element.prototype.classList) {
Element.prototype.classList = {};
Element.prototype.classList.contains =
function(class_name){
console.log(this)
}
}
的执行console.log一个备份功能(这)返回“未定义”,我如何获取函数被调用的元素呢?
你怎么称呼它? – Bergi
https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills#classlist – Bergi