gpt4 book ai didi

javascript - 未捕获的类型错误 : Object [object Object] has no method 'validationEngine'

转载 作者:行者123 更新时间:2023-11-30 17:48:17 25 4
gpt4 key购买 nike

我只是想问问我的问题。我收到这个错误

Uncaught ReferenceError: jQuery is not defined jquery.validationEngine-en.js:192
Uncaught ReferenceError: jQuery is not defined
Uncaught TypeError: Object [object Object] has no method 'validationEngine'

当我尝试使用 jquery 验证引擎插件验证我的表单时。我按照说明进行操作,但不知道为什么会出现此错误。我还仔细检查了路径,它也在工作。这是我的示例代码:

<html>
<head>
<title>TEST</title>

<script type='text/javascript' src='http://localhost/mycrud/./third_party/jquery-validation/js/languages/jquery.validationEngine-en.js'></script>
<script type='text/javascript' src='http://localhost/mycrud/./third_party/jquery-validation/js/jquery.validationEngine.js'></script>
<link rel='stylesheet' type='text/css' href='http://localhost/mycrud/./third_party/jquery-validation/css/validationEngine.jquery.css' />

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>

</head>
<body>

<form id="formID" method="post" action="submit.action">
<input value="someone@nowhere.com" class="validate[required,custom[email]]" type="text" name="email" id="email" />
</form>

<script type="text/javascript">
$(document).ready(function(){
$("#formID").validationEngine();
});
</script>

</body>

</html>

最佳答案

在加载验证 脚本之前,在顶部加载您的jQuery 库

因为它依赖于 jQuery 库,所以您不能在定义它们之前使用 $jQuery,因此请先加载库。

以这种方式加载:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type='text/javascript' src='http://localhost/mycrud/./third_party/jquery-validation/js/languages/jquery.validationEngine-en.js'></script>
<script type='text/javascript' src='http://localhost/mycrud/./third_party/jquery-validation/js/jquery.validationEngine.js'></script>
<link rel='stylesheet' type='text/css' href='http://localhost/mycrud/./third_party/jquery-validation/css/validationEngine.jquery.css' />

关于javascript - 未捕获的类型错误 : Object [object Object] has no method 'validationEngine' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19647913/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com