gpt4 book ai didi

javascript - Jquery冲突问题

转载 作者:行者123 更新时间:2023-11-28 15:30:48 27 4
gpt4 key购买 nike

我在头文件中使用了许多js文件,如下所示

<script src="{$BASE_URL}js/jquery.form.js" type="text/javascript"></script>
<script src="{$BASE_URL}js/cmxforms.js" type="text/javascript"></script>
<script src="{$BASE_URL}js/jquery.metadata.js" type="text/javascript"></script>
<script src="{$BASE_URL}js/jquery.validate.min.js" type="text/javascript"></script>
<script src="{$BASE_URL}js/functions.js" type="text/javascript"></script>
<script src="{$BASE_URL}js/jquery-1.10.1.min.js" type="text/javascript"> </script>


<script type="text/javascript" src="{$BASE_URL}js/jquery-ui.min.js" > </script>
<script type="text/javascript" src="{$BASE_URL}js/timepicker/jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript" src="{$BASE_URL}js/jquery-ui-sliderAccess.js"></script>
<script type="text/javascript" src="{$BASE_URL}js/jspatch.js"></script>
<script src="{$BASE_URL}js/script.js" type="text/javascript"></script>

<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script type="text/javascript">

我收到如下错误。

$(...).live is not a function in    

$("#reset").live('click',function(){

findproject (line 925)


SyntaxError: syntax error


<script type="text/javascript">//<![CDATA

$(...).validate is not a function

所以,问题出在哪里。我没有得到确切的方法。验证功能不起作用

最佳答案

您需要将核心 jquery 库放在顶部,因为这是解决其他 jquery 库的依赖关系所必需的-

<!-- This must be first library to inlcude-->
<script src="{$BASE_URL}js/jquery-1.10.1.min.js" type="text/javascript"> </script>

<script src="{$BASE_URL}js/jquery.form.js" type="text/javascript"></script>
<script src="{$BASE_URL}js/cmxforms.js" type="text/javascript"></script>
<script src="{$BASE_URL}js/jquery.metadata.js" type="text/javascript"></script>
<script src="{$BASE_URL}js/jquery.validate.min.js" type="text/javascript"></script>
<script src="{$BASE_URL}js/functions.js" type="text/javascript"></script>

<script type="text/javascript" src="{$BASE_URL}js/jquery-ui.min.js" > </script>
<script type="text/javascript" src="{$BASE_URL}js/timepicker/jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript" src="{$BASE_URL}js/jquery-ui-sliderAccess.js"></script>
<script type="text/javascript" src="{$BASE_URL}js/jspatch.js"></script>
<script src="{$BASE_URL}js/script.js" type="text/javascript"></script>

<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script type="text/javascript">

此外,此版本不提供 .live(),您应该使用 .on()

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

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