Home > front end >  The JSP using the import into another page, jquery repeated references, resulting in $(... ). The va
The JSP using the import into another page, jquery repeated references, resulting in $(... ). The va

Time:10-04

Using the validate jQuery plugin on a JSP, inside the body to use & lt; C: import> Import after another page, the original can be used to validate verify all can't use, web page error $(... ). The validate is not a function, two pages used alone is no problem, the problem can be locked is to import the page also have cited the jquery problem, could you tell me how to solve ah, to
Here is the place where I two pages using jquery,
<script type="text/javascript" SRC="https://bbs.csdn.net/topics/${pageContext. Request. ContextPath}/js/jquery. Validate the js" & gt; </script>
<script type="text/javascript" SRC="https://bbs.csdn.net/topics/${pageContext. Request. ContextPath}/js/messages_zh js" & gt; </script>
<script>
/* definition can only enter letters and Numbers */
JQuery. The validator. AddMethod (" zimuShuzi ", the function, value, element) {
Return this. Optional (element) | |/^ [a zA - Z0-9] + $/. The test (value);
}, "user name support letters and Numbers only");
</script>
<script>
Var validateFlag;
$(function () {
$(" # editor_passwordForm "). The validate ({
Rules: {
OldPassword: {
Required: true,
},
NewPassword: {
Required: true,
ZimuShuzi: true,
Rangelength: [3, 15],
},
AgainPassword: {
EqualTo: "# newPassword"
},
Truename: {},
},
Messages: {
AgainPassword: {
EqualTo: "enter the password twice, please confirm again"
}
}
});
});
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
<script type="text/javascript" SRC="https://bbs.csdn.net/topics/${pageContext. Request. ContextPath}/js/xcConfirm/js/xcConfirm js" & gt; </script>
<script>
The function exitSystem () {
Var flag=window. The WXC. XcConfirm (" confirm exit system?" , window. WXC. XcConfirm. TypeEnum. Confirm, {
OnOk: function () {
Window. The location. Href="https://bbs.csdn.net/topics/${contextPath}/exitServlet";
},
OnCancel function () {
return ;
}
});

}
</script>
  • Related