小bug找的頭大,記錄一下
head標(biāo)簽中js鏈接改為https
?? rules: {}檢查多一個(gè)右大括號(hào)
<!DOCTYPE html>
<html>
? ? <head>
? ? ? ? <title>表單驗(yàn)證插件</title>
? ? ? ? <link href="style.css" rel="stylesheet" type="text/css" />
? ? ? ? <script type="text/javascript" src="http://idcbgp.cn/data/jquery-1.8.2.min.js"></script>
? ? ? ? <script type="text/javascript" src="http://idcbgp.cn/data/jquery.validate.js"></script>
? ? ? ? <script type="text/javascript" src="http://idcbgp.cn/data/jquery.validate.messages_cn.js"></script>
? ? </head>
? ? <body>
? ? ? ? <form id="frmV" method="get" action="#">
? ? ? ? ? ? <div id="divtest">
? ? ? ? ? ? ? ? <div class="title">
? ? ? ? ? ? ? ? ? ? <span class="fl">表單驗(yàn)證插件</span>?
? ? ? ? ? ? ? ? ? ? <span class="fr">
? ? ? ? ? ? ? ? ? ? ? ? <input id="btnSubmit" type="submit" value="提交" />
? ? ? ? ? ? ? ? ? ? </span>
? ? ? ? ? ? ? ? </div>
? ? ? ? ? ? ? ? <div class="content">
? ? ? ? ? ? ? ? ? ? <span class="fl">郵箱:</span><br />
? ? ? ? ? ? ? ? ? ? <input id="email" name="email" type="text" /><br />
? ? ? ? ? ? ? ? ? ? <span class="tip"></span>
? ? ? ? ? ? ? ? </div>
? ? ? ? ? ? </div>
? ? ? ? </form>
? ? ? ??
? ? ? ? <script type="text/javascript">
? ? ? ? ? ? $(function () {
? ? ? ? ? ? ? ? $("#frmV").validate(
? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? /*自定義驗(yàn)證規(guī)則*/
? ? ? ? ? ? ? ? ? ? ? rules: {
? ? ? ? ? ? ? ? ? ? ? ? email:{
? ? ? ? ? ? ? ? ? ? ? ? required:true,
? ? ? ? ? ? ? ? ? ? ? ? email:true
? ? ? ? ? ? ? ? ? ? ? ? }? ??
? ? ? ? ? ? ? ? ? ? ? },
? ? ? ? ? ? ? ? ? ? ? /*錯(cuò)誤提示位置*/
? ? ? ? ? ? ? ? ? ? ? errorPlacement: function (error, element) {
? ? ? ? ? ? ? ? ? ? ? ? ? error.appendTo(".tip");
? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? );
? ? ? ? ? ? });
? ? ? ? </script>
? ? </body>
</html>
2023-02-28
你這個(gè)用一個(gè)比較好的編輯器開發(fā)呀,直接就報(bào)出來了