gpt4 book ai didi

javascript - jquery.min.js 冲突

转载 作者:行者123 更新时间:2023-11-30 06:59:25 25 4
gpt4 key购买 nike

当我添加以下脚本时,它会影响项目的其他功能(Spring 应用程序)

  <script type="text/javascript" src="${ctx}/js/jquery-1.3.2.min.js"></script>

我的代码

    <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>

我怀疑是因为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 !');
}
})
});

关于javascript - jquery.min.js 冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17086982/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com