admin管理员组文章数量:1356685
I have been trying to figure out why I am getting this problem and cannot figure it out. I am guessing it has to do with the libraries added but I am a newby and have spent like 2 days trying different things. The problem here is for the function calling the fancybox, but it happens whenever I call the document.ready.
Here is the code:
<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-ments" style="margin-top: 10px">
<div class="left-side">
<p class="top-ment-title">Michigan</p>
<div class="top-ment-wrapper">
<div class="top-ment-header">
<span class="user-name">Andrew P.</span>
<div class="fix"></div>
</div>
<p class="top-ment-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-ment-title">Notre Dame</p>
<div class="top-ment-wrapper">
<div class="top-ment-header dispute-ment">
<span class="user-name">Jenny S.</span>
<div class="fix"></div>
</div>
<p class="top-ment-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-ment-title">Michigan</p>
</div>
<div class="right-side">
<p class="top-ment-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>
Thanks for your help! Luis
I have been trying to figure out why I am getting this problem and cannot figure it out. I am guessing it has to do with the libraries added but I am a newby and have spent like 2 days trying different things. The problem here is for the function calling the fancybox, but it happens whenever I call the document.ready.
Here is the code:
<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-ments" style="margin-top: 10px">
<div class="left-side">
<p class="top-ment-title">Michigan</p>
<div class="top-ment-wrapper">
<div class="top-ment-header">
<span class="user-name">Andrew P.</span>
<div class="fix"></div>
</div>
<p class="top-ment-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-ment-title">Notre Dame</p>
<div class="top-ment-wrapper">
<div class="top-ment-header dispute-ment">
<span class="user-name">Jenny S.</span>
<div class="fix"></div>
</div>
<p class="top-ment-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-ment-title">Michigan</p>
</div>
<div class="right-side">
<p class="top-ment-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>
Thanks for your help! Luis
Share Improve this question edited Jun 16, 2012 at 2:57 Danconia asked Jun 14, 2012 at 23:50 DanconiaDanconia 5632 gold badges12 silver badges28 bronze badges 2- 3 You haven't included jQuery correctly. Triple check the location of jquery.js. – Andrew Whitaker Commented Jun 14, 2012 at 23:51
- @AndrewWhitaker, I did not? If I link to sofiaandluis./luis/public/scripts/jquery.min.js I can see the jQuery file. Is that not it? – Danconia Commented Jun 14, 2012 at 23:55
2 Answers
Reset to default 4You load Modernizr right after jQuery library somehow (in applicat.js), so $
variable gets rewritten. Use jQuery in 'noConflict' mode, or use Modernizr to load jQuery as described here.
You didn't reference jQuery successfully.
Check this:
alert(typeof $ == "undefined");
alert(typeof jQuery == "undefined");
If those are true, jQuery was not loaded to the page.
Change:
<script type="text/javascript" src="public/scripts/jquery.min.js"></script>
To:
<script type="text/javascript" src="http://www.sofiaandluis./luis/public/scripts/jquery.min.js"></script>
本文标签: javascriptUncaught TypeError Object ltHTMLDocumentgt has no method 39ready39Stack Overflow
版权声明:本文标题:javascript - Uncaught TypeError: Object #<HTMLDocument> has no method 'ready' - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743951329a2567344.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论