我有一点javascript,我试图解开,它是在PHP窗体上计算抵押还款,但单击计算按钮什么也不做。Javascript:未定义不是函数错误
看着Chrome的控制台我得到的消息
下面的代码的Uncaught TypeError: Undefined is not a function" on line 10($("#form_7") to 19
。
<script type="text/javascript">
$(document).ready(function() {
$("a.ActiveButton").bind({
mousedown:function(){
if ($(this).attr('disabled') === undefined)
$(this).addClass('Activated');
},
mouseleave:function(){
if ($(this).attr('disabled') === undefined)
$(this).removeClass('Activated');
},
mouseup:function(){
if ($(this).attr('disabled') === undefined)
$(this).removeClass('Activated');
}
});
$("#form_7").validate({
onkeyup: false,
showErrors: function(errorMap, errorList) {
if (errorList.length) alert(errorList[0].message);
},
onclick: false,
rules: {
'Property_Price': { number: true } ,
'Deposit': { number: true } ,
'Duration': { number: true } ,
'InterestRate': { number: true }
},
onfocusout: false,
messages: {
'Property_Price': { number: "Please enter the property purchase price." } ,
'Deposit': { number: "Please enter your deposit amount or 0 if there is no deposit." } ,
'Duration': { number: "Please enter the duration of the mortgage." } ,
'InterestRate': { number: "Please enter the mortgage interest rate." }
}
});
$('#btn_4').click(function(){validate_form_7(form_7)});
});
</script>
有谁知道是什么原因导致这个错误以及它如何解决?
我不认为你已经导入jquery – Jordy 2014-11-25 12:39:36
这是可能的,但通常在这种情况下,错误信息是:['未捕获的ReferenceError:$未定义](http://jsfiddle.net/davidThomas/dybmn6rk/1/ )。 – 2014-11-25 12:41:58
jQuery可能在那里,但验证插件可能不是。 – Deleteman 2014-11-25 12:44:27