jquery dwr $符冲突


今天发现dwr的东西与jquery的$符号有冲突,解决办法如下:var j = jQuery.noConflict();
把所有的$符都替换成j就可以了。

<script language="JavaScript" src="dwr/interface/LoginDwrAction.js"> </script>
<script language="JavaScript" src="dwr/engine.js"> </script>
<script language="JavaScript" src="dwr/util.js"> </script>
<script language="JavaScript" type="text/JavaScript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/login.js"></script>     <script src="${ctx}/js/validate/messages_cn.js" type="text/javascript"></script>
<script type="text/javascript" SRC="js/jquery.validate_pack.js"></script>
     <script>
     var j = jQuery.noConflict();
j(document).ready(function() {
//为subscription注册validate函数
j("#subscriptionForm").validate({
rules: {
keyWord: "required",
count: "required",
email: {
required: true,
email: true
}
}, messages: {
keyWord: {
required: "关键字不能为空"
},
count: {
required: "该数值不能为空"
},
email:{
    required:"邮箱不能为空",
    email:"邮箱格式不正确"
}
}, });
});
    </script>

你可能感兴趣的:(jquery dwr $)