Snackjs 零食分离功能在IE中不起作用
我正在使用Snackjs 零食分离功能在IE中不起作用,snackjs,Snackjs,我正在使用snackjs库 wrap.detach(名称空间)在IE8中引发了预期对象“错误 说明: detach: function (namespace){ listenerMethod(this, 'detach', namespace, null, true) this.data(namespace, null) return this }, function listenerMethod(wrapper, method, namespace, arg
snackjs
库
wrap.detach(名称空间)
在IE8中引发了预期对象“
错误
说明:
detach: function (namespace){
listenerMethod(this, 'detach', namespace, null, true)
this.data(namespace, null)
return this
},
function listenerMethod(wrapper, method, namespace, args){
var data = wrapper.data(namespace)
if (data)
snack.each(data, function (listener){
listener[method].apply(wrapper, args)
})
return wrapper
}
在listenerMethod中传递的第四个参数(这是'detach',namespace,null,true)
是null
所以listener[method].apply(包装器,参数)
他犯了错误
这是因为在IE8中
function.apply(obj,null)
将抛出错误