当我添加以下脚本时,它会影响项目的其他功能(Spring Application)
<script type="text/javascript" src="${ctx}/js/jquery-1.3.2.min.js"></script>
Run Code Online (Sandbox Code Playgroud)
我的守则
<script type="text/javascript" src="${ctx}/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="${ctx}/js/easy.notification.js"></script>
<script type="text/javascript">
$.noConflict();
$(function() {
$("input[type='text']").blur(function() {
if (this.value === '') {
$.easyNotificationEmpty('Warning : You left this field empty !');
} else {
$.easyNotification('Saved Successfully !');
}
})
});
</script>
Run Code Online (Sandbox Code Playgroud)
我怀疑是因为冲突 jquery-1.3.2.min.js
我试过了$.noConflict();,但没有得到理想的结果.
请帮我解决这个问题,提前谢谢.
试试这个,
jQuery(function($) {
$("input[type='text']").blur(function() {
if (this.value === '') {
$.easyNotificationEmpty('Warning : You left this field empty !');
} else {
$.easyNotification('Saved Successfully !');
}
})
});
Run Code Online (Sandbox Code Playgroud)