大家好~
最近遇到 Uncaught TypeError: $(...).on is not a function这种类型的错误,
起源是参考
http://goo.gl/W3CniV
此网站想学写to do list
但于todo.js中加入自己的function并呼叫了todo.js中的runBind()
runBind()程式码仅如下这样
function runBind()
{
$('.destroy').on('click', function(e)
{
$currentListItem = $(this).closest('li');
$currentListItem.remove();
});
}
于原本todo.js呼叫runBind()的地方却是正常的。
但于自己的function中呼叫却会出现错误。
就出现标题这类型的错误,上网爬了一些文章,但摸不著头绪。
想请问这类型的问题该怎么解决呢?