在Chrome调试器中,Uncaught TypeError: undefined is not a function
当解析以下代码时,我得到一个:
var pay = '{{payt}}';
if (pay.contains('visa')){
$('#visa').prop('checked', true);
}
但是,这在Firefox中不会引起任何问题并执行代码。是什么会导致此错误?
编辑:indexOf()
作品-
if (pay.indexOf("visa")!=-1){
$('#visa').prop('checked', true);
}
根据MDN文档,Chrome尚不支持.contains函数。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句