javascript TypeError: $(...).validate 不是 Jquery-dialog 上的函数
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17358859/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
TypeError: $(...).validate is not a function on Jquery-dialog
提问by Caponera
I want to use the technique's validate on Jquery-ui-Dialog but I have the error TypeError: $(...).validate is not a function
that I find with Firebug .
我想在 Jquery-ui-Dialog 上使用该技术的验证,但我在TypeError: $(...).validate is not a function
Firebug 中发现了错误。
I don't know because I have this error. This is to think that I have to load a library but I loading:
我不知道,因为我有这个错误。这是认为我必须加载一个库,但我正在加载:
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.js"></script>
That I take on Jqueryvalidation.
我接受Jqueryvalidation。
I created my case on Jsbinand to make it work exactly I want to see the alert.
我在Jsbin上创建了我的案例,并使其正常工作,我想看到警报。
Obviously after I replace with the form. I don't know if I can not to use the latest library of Jquery.
显然在我用表格替换之后。不知道能不能用最新的Jquery库。
Thank and I hope I was clear.
谢谢,我希望我很清楚。
回答by bipen
You need to load the main jquery script first.. and then the validate.js since validate requires jquery...(you are loading validate.js first and jquery.js after that)
您需要先加载主 jquery 脚本..然后是 validate.js 因为验证需要 jquery ...(您首先加载 validate.js 和 jquery.js 之后)
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-2.0.0.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.js"></script>
.....
.....