我想对这个案子有所帮助:
实际上,我有一个表单,我尝试使用不同的规则来管理它。该表格不起作用,因为我的导航器上出现此错误:
TypeError: $.validator.methods[method] is undefined
...result = $.validator.methods[method].call( this, val, element, rule.parameters )
我在firebug中查看了HTML屏幕,我看到了:
<head>
<script id="undefined" type="text/javascript" async="" src="http://www.google-analytics.com/plugins/ga/inpage_linkid.js">
<script async="" src="//www.googletagmanager.com/gtm.js?id=GTM-NQP3WH">
<script type="text/javascript" async="" src="http://stats.g.doubleclick.net/dc.js">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js" type="text/javascript">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js" type="text/javascript">
<script src="/snippet/js/library/bootstrap.js" type="text/javascript">
<script src="/snippet/js/library/jquery.validate.js" type="text/javascript">
<script src="/snippet/js/library/jquery.placeholder.js" type="text/javascript">
<script src="/snippet/js/library/jquery.cluetip.js" type="text/javascript">
<script src="/snippet/js/library/jquery-ui-1.9.2.custom.min.js" type="text/javascript">
<script src="/snippet/js/library/respond.min.js" type="text/javascript">
<script src="/snippet/js/script.js" type="text/javascript">
<script src="/snippet/js/form-devis.js" type="text/javascript">
<script src="/snippet/js/index.js" type="text/javascript">
<link media="all" href="/snippet/css/bootstrap.css" type="text/css" rel="stylesheet">
<link media="all" href="/snippet/css/jquery-ui-1.9.2.custom.css" type="text/css" rel="stylesheet">
<link media="all" href="/snippet/css/jquery.cluetip.css" type="text/css" rel="stylesheet">
<link media="all" href="" type="text/css" rel="stylesheet">
<link media="all" href="/snippet/branding/colis-urgent/added.css" type="text/css" rel="stylesheet">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title>Envoi colis Urgent / express </title>
<script type="text/javascript" src="/js/library/jquery.validate.js">
<script type="text/javascript">
<script type="text/javascript">
<style type="text/css">
</head>
然后我怀疑包含了.JS的错误顺序。我与另一种完美运作的形式进行了比较:
#if($ieOldBrowser)
#set($d = $jsExternalSet.addAll([
'//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js',
'//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.js',
'/js/library/respond.js'
]))
#else
#set($d = $jsExternalSet.addAll([
'//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js',
'//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js'
]))
#end
#set($d = $jsCommonSet.addAll([
'/js/library/jquery.validate.js',
'/js/library/jquery.placeholder.js',
'/js/library/jquery.cluetip.js',
'/js/library/jquery-ui-1.9.2.custom.min.js',
'/js/inscription.js.vtl',
'/js/form-contact-mail.js',
'/js/form-devis.js',
'/js/popup-address.js',
'/js/sha1.js',
'/js/login.js',
'/js/form-login.js',
'/js/tooltip.js',
'/js/script.js'
]))
但显然不是那样的。如果你有想法建议我,请告诉我......
啤酒。