TypeError:$(...).dotdotdot不是函数吗? [英] TypeError: $(...).dotdotdot is not a function?
问题描述
这里有一个多方面的问题,但我将从主要问题开始.
A multipart question here, but I'll start with the main problem.
-
我在让jQuery插件在我正在设计的网站上工作时遇到问题. FireBug告诉我"TypeError:$(...).dotdotdot不是函数".但是,我已经按照正确的顺序加载了Jquery库.有人知道为什么我的插件会产生该错误吗?
I'm having issues getting a jQuery plugin to work on a site I'm designing. FireBug is telling me that "TypeError: $(...).dotdotdot is not a function". However, I've loaded the Jquery libraries in the correct order. Does anyone know why my plugin is generating that error?
Pi带了……我正在尝试使用'dotdotdot'截断从Tumblr RSS feed中提取的元数据.我是否在脚本中正确选择了该元素,还是应该将其指向其他div/ID?目前,它正在寻找"#miniblog_d".
Piggybacking off of that... I'm trying to use 'dotdotdot' to truncate metadata pulled from a Tumblr RSS feed. Am I properly selecting that element in the script, or should I be pointing it at a different div/ID? Currently it's looking for "#miniblog_d".
感谢大家的帮助!老实说,这已经让我难受了几周.如果您查看文件,您会注意到我正在加载jQuery库的巨额赎金,并且如果有方法可以仅加载一个,请告诉我.我只需要在顶部加载最新的jQuery文件,就没有其他脚本可以工作.
Thanks everyone for any assistance! This one has been stumping me for a few weeks honestly. If you review the file you'll notice I'm loading a king's ransom of jQuery libraries, and if there's a way to just load one, please let me know. I haven't gotten any other scripts to work by just loading the latest jQuery file at the top.
谢谢!
很抱歉-这里完全空白-实时示例在 http://tinychivalry.com/cjyoga/
edit: I'm sorry - totally blanked here - live example is at http://tinychivalry.com/cjyoga/
推荐答案
您正在页面上加载多个版本的jQuery.您实际上是这样做的:
You're loading more than one version of jQuery on your page. You're actually doing it like this:
version X of jQuery
dotdotdot plugin
...
...
version Y of jQuery
...
...
发生了什么事,dotdotdot
插件已附加"到jQuery版本X的原型中,但是随后您加载了版本Y,该版本将覆盖版本X,并使其所附加的所有内容均不可访问,包括您的dotdotdot
插件.
What's happening is that the dotdotdot
plugin is "attached" to the prototype of version X of jQuery, but then you load version Y, which overwrites version X, and makes everything attached to it no longer accessible, including your dotdotdot
plugin.
这是您的标头代码:
<script type="text/javascript" src="custom_js/jquery-1.9.1.js"></script>
<script type="text/javascript" language="javascript" src="custom_js/jquery.dotdotdot.min.js"></script>
<link rel="stylesheet" type="text/css" media="screen, print, projection" href="sg_reset.css" />
<link rel="stylesheet" type="text/css" media="screen, print, projection" href="drag_system.css" />
<!-- -->
<link rel="stylesheet" type="text/css" media="screen, print, projection" href="cjyogaweb_common.css" />
<link rel="stylesheet" type="text/css" media="screen, print, projection" href="cjyogaweb_common_textstyles.css" />
<!-- -->
<!-- -->
<script type="text/javascript" src="sg_jscripts/jquery_1.5.2_min.js"></script>
看看如何加载1.9.1,然后加载1.5.2?那是你的问题.请仅使用单个版本的jQuery,否则有很多原因使之荒谬.
See how you're loading 1.9.1 and then 1.5.2 after it? That is your problem. Please only use a single version of jQuery, there are several reasons why it's ridiculous to do otherwise.
编辑我重新阅读了您的文章,发现您确实加载了各种版本的jQuery(技术术语).毫无疑问,这是错误的.
EDIT I just re-read your post and saw that you are indeed loading a crapload (technical term) of various versions of jQuery. This is, in no uncertain terms, wrong.
这篇关于TypeError:$(...).dotdotdot不是函数吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!