gpt4 book ai didi

javascript - 未捕获的类型错误 : Object # has no method 'ready'

转载 作者:行者123 更新时间:2023-11-29 16:20:20 24 4
gpt4 key购买 nike

我一直在试图弄清楚为什么我会遇到这个问题,但无法弄清楚。我猜这与添加的库有关,但我是新手,花了 2 天时间尝试不同的东西。这里的问题是调用 fancybox 的函数,但是每当我调用 document.ready 时它就会发生。

代码如下:

<head>
<script type="text/javascript" src="public/scripts/jquery.min.js"></script> <!-- 1.7.2 -->
<script src="public/scripts/applicat.js" type="text/javascript"></script>

<!--Add link fancybox-->
<script type="text/javascript" src="public/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<link rel="stylesheet" href="public/fancybox/jquery.fancybox-1.3.4.css" type="text/css" media="screen" />
<script type="text/javascript">
$(document).ready(function() {
$("#add-iframe").fancybox({
'hideOnContentClick': true
});
});
</script></head>

<section id="top-comments" style="margin-top: 10px">
<div class="left-side">
<p class="top-comment-title">Michigan</p>
<div class="top-comment-wrapper">
<div class="top-comment-header">
<span class="user-name">Andrew P.</span>
<div class="fix"></div>
</div>
<p class="top-comment-content">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer</p>
</div>
</div>
<div class="right-side">
<p class="top-comment-title">Notre Dame</p>
<div class="top-comment-wrapper">
<div class="top-comment-header dispute-comment">
<span class="user-name">Jenny S.</span>
<div class="fix"></div>
</div>
<p class="top-comment-content">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer</p>
</div>
</div>
<div class="fix"></div>
</section>

<!-- Articles -->
<section id="top-resources" style="display:none; margin-top:10px">
<a id="add-iframe" href="add-link.html" class="top-add-link">Add Link</a>
<div class="left-side">
<p class="top-comment-title">Michigan</p>
</div>
<div class="right-side">
<p class="top-comment-title">Notre Dame</p>
</div>
<div class="fix"></div>
</section>
</div>

<script type="text/javascript" charset="utf-8">
jQuery().ready(function() {
jQuery("#discussion-sections > nav ul").tabs("#discussion-sections > section");
});
</script>

感谢您的帮助!路易斯

最佳答案

您以某种方式(在 applicat.js 中)在 jQuery 库之后立即加载 Modernizr,因此 $ 变量被重写。在“noConflict”中使用 jQuery ' 模式,或按照描述使用 Modernizr 加载 jQuery here .

关于javascript - 未捕获的类型错误 : Object #<HTMLDocument> has no method 'ready' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11042905/

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