为什么JS小提琴给我的错误'未捕获TypeError: undefined不是一个函数'
Why does JS Fiddle give me the error `Uncaught TypeError: undefined is not a function `?
我正在测试一个Plupload脚本时,我一直得到' Uncaught TypeError: undefined不是一个函数。
不知道为什么,我用jQuery的一个例子进行了测试。我得到相同的错误(se fiddle)。
谁能告诉我为什么这不起作用?
代码:$( "div" ).greenify({
color: "orange"
});
(function ( $ ) {
$.fn.greenify = function( options ) {
// Do stuff here
};
}( jQuery ));
因为它们的顺序不对:
// First add the plugin
(function ( $ ) {
$.fn.greenify = function( options ) {
// Do stuff here
};
}( jQuery ));
// THEN use it
$( "div" ).greenify({
color: "orange"
});
更新小提琴
事物的一般顺序是:
- jQuery的
-
script
标签的任何插件 -
script
标签用于您的代码
script
标签相关文章:
- 为什么会出现错误;未捕获的类型错误:undefined不是函数;
- 为什么会出现错误,“UncaughtTypeError:undefined不是函数”
- mongoose.connect undefined不是一个函数
- Uncaught TypeError:undefined不是函数-ember js
- jQuery Mobile Undefined不是一个函数
- 未捕获的类型错误:undefined不是函数$
- 使用在函数外部声明的变量的 Javascript 返回值 + undefined
- 为什么Grunt Copy给了我一个'undefined不是函数'警告
- Bootstrap-“;未捕获的类型错误:undefined不是函数;
- Undefined不是函数ImpressPages DatePicker
- 尝试使用.ninnerHTMLlog打印数据,获取错误Uncaught TypeError:undefined不是函数
- 得到“;undefined不是函数“;错误
- Undefined不是Fullcalendar js上的函数
- 使用谷歌地图:一个返回undefined的自定义javascript函数
- jqGrid:undefined不是函数
- Jquery,Uncaught TypeError:undefined不是函数
- $http.post undefined 不是函数
- Ember cli Uncatch TypeError: undefined 不是函数
- Infragistics igGrid Uncatch TypeError: undefined 不是一个函数
- JQuery脚本在Firefox上工作;undefined不是函数“;铬