我在我的页面上使用jquery,并没有其他部分的问题.即使$ .post和$ .get也能正常工作.
现在我正在尝试评估图像是否有任何问题并尝试此代码:
$("#bib").error(function(){
//nothing now
});
Run Code Online (Sandbox Code Playgroud)
我想知道为什么我得到这个错误:
Uncaught TypeError: $(...).error is not a function
at app.js:53
(anonymous) @ app.js:53
Run Code Online (Sandbox Code Playgroud)
如你所见,我缩短了代码以隔离问题,但你得到了全部的想法.目前,这些jquery源包含在页面内:
https://code.jquery.com/jquery-3.1.0.min.js https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js
知道为什么会这样吗?
改为使用它(如前所述,已删除.error).
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script>
$("#bib").on('error', function(){
//nothing now
});
</script>
Run Code Online (Sandbox Code Playgroud)