admin管理员组文章数量:1245087
As soon as I load JqueryMobile in my web application I receive this error, unfortunately I'm not able to understand why this problem. Could you point me in the right direction? Thanks!
Uncaught TypeError: Object function ( name, base, prototype ) {
var namespace = name.split( "." )[ 0 ],
fullName;
name = name.split( "." )[ 1 ];
fullName = namespace + "-" + name;
if ( !prototype ) {
prototype = base;
base = $.Widget;
}
// create selector for plugin
$.expr[ ":" ][ fullName ] = function( elem ) {
return !!$.data( elem, name );
};
$[ namespace ] = $[ namespace ] || {};
$[ namespace ][ name ] = function( options, element ) {
// allow instantiation without initializing for simple inheritance
if ( arguments.length ) {
this._createWidget( options, element );
}
};
var basePrototype = new base();
// we need to make the options hash a property directly on the new instance
// otherwise we'll modify the options hash on the prototype that we're
// inheriting from
// $.each( basePrototype, function( key, val ) {
// if ( $.isPlainObject(val) ) {
// basePrototype[ key ] = $.extend( {}, val );
// }
// });
basePrototype.options = $.extend( true, {}, basePrototype.options );
$[ namespace ][ name ].prototype = $.extend( true, basePrototype, {
namespace: namespace,
widgetName: name,
widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name,
widgetBaseClass: fullName
}, prototype );
$.widget.bridge( name, $[ namespace ][ name ] );
} has no method 'extend' jquery.mobile-1.2.0.js:568
$.Widget._createWidget jquery.mobile-1.2.0.js:568
$.(anonymous function).(anonymous function) jquery.mobile-1.2.0.js:405
(anonymous function) jquery.mobile-1.2.0.js:541
jQuery.extend.each jquery-1.8.2.js:611
jQuery.fn.jQuery.each jquery-1.8.2.js:241
$.fn.(anonymous function) jquery.mobile-1.2.0.js:536
(anonymous function) jquery.mobile-1.2.0.js:1091
jQuery.event.dispatch jquery-1.8.2.js:3063
elemData.handle.eventHandle jquery-1.8.2.js:2681
jQuery.event.trigger jquery-1.8.2.js:2946
(anonymous function) jquery-1.8.2.js:3604
jQuery.extend.each jquery-1.8.2.js:611
jQuery.fn.jQuery.each jquery-1.8.2.js:241
jQuery.fn.extend.trigger jquery-1.8.2.js:3603
$.extend.initializePage jquery.mobile-1.2.0.js:9082
(anonymous function) jquery.mobile-1.2.0.js:9140
fire jquery-1.8.2.js:974
self.fireWith jquery-1.8.2.js:1082
jQuery.extend.ready jquery-1.8.2.js:406
DOMContentLoaded
As soon as I load JqueryMobile in my web application I receive this error, unfortunately I'm not able to understand why this problem. Could you point me in the right direction? Thanks!
Uncaught TypeError: Object function ( name, base, prototype ) {
var namespace = name.split( "." )[ 0 ],
fullName;
name = name.split( "." )[ 1 ];
fullName = namespace + "-" + name;
if ( !prototype ) {
prototype = base;
base = $.Widget;
}
// create selector for plugin
$.expr[ ":" ][ fullName ] = function( elem ) {
return !!$.data( elem, name );
};
$[ namespace ] = $[ namespace ] || {};
$[ namespace ][ name ] = function( options, element ) {
// allow instantiation without initializing for simple inheritance
if ( arguments.length ) {
this._createWidget( options, element );
}
};
var basePrototype = new base();
// we need to make the options hash a property directly on the new instance
// otherwise we'll modify the options hash on the prototype that we're
// inheriting from
// $.each( basePrototype, function( key, val ) {
// if ( $.isPlainObject(val) ) {
// basePrototype[ key ] = $.extend( {}, val );
// }
// });
basePrototype.options = $.extend( true, {}, basePrototype.options );
$[ namespace ][ name ].prototype = $.extend( true, basePrototype, {
namespace: namespace,
widgetName: name,
widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name,
widgetBaseClass: fullName
}, prototype );
$.widget.bridge( name, $[ namespace ][ name ] );
} has no method 'extend' jquery.mobile-1.2.0.js:568
$.Widget._createWidget jquery.mobile-1.2.0.js:568
$.(anonymous function).(anonymous function) jquery.mobile-1.2.0.js:405
(anonymous function) jquery.mobile-1.2.0.js:541
jQuery.extend.each jquery-1.8.2.js:611
jQuery.fn.jQuery.each jquery-1.8.2.js:241
$.fn.(anonymous function) jquery.mobile-1.2.0.js:536
(anonymous function) jquery.mobile-1.2.0.js:1091
jQuery.event.dispatch jquery-1.8.2.js:3063
elemData.handle.eventHandle jquery-1.8.2.js:2681
jQuery.event.trigger jquery-1.8.2.js:2946
(anonymous function) jquery-1.8.2.js:3604
jQuery.extend.each jquery-1.8.2.js:611
jQuery.fn.jQuery.each jquery-1.8.2.js:241
jQuery.fn.extend.trigger jquery-1.8.2.js:3603
$.extend.initializePage jquery.mobile-1.2.0.js:9082
(anonymous function) jquery.mobile-1.2.0.js:9140
fire jquery-1.8.2.js:974
self.fireWith jquery-1.8.2.js:1082
jQuery.extend.ready jquery-1.8.2.js:406
DOMContentLoaded
Share
Improve this question
asked Oct 6, 2012 at 7:32
GibboKGibboK
73.9k147 gold badges451 silver badges672 bronze badges
2 Answers
Reset to default 18I fixed this by removing jquery.ui.widget.js which was probably required at some time in the distant past, but not any more.
I realize that the problem was appearing when jquery ui library was loaded. After some digging I found out the the two libraries could have some issue.
本文标签:
版权声明:本文标题:javascript - Uncaught TypeError: Object function ( name, base, prototype ) when laoding Jquery Mobile - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1740243945a2247890.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论