2012-10-06 27 views
2

一旦我加載JqueryMobile在我的web應用程序中,我收到這個錯誤,不幸的是我無法理解爲什麼這個問題。你能指出我正確的方向嗎?謝謝!Uncaught TypeError:對象函數(名稱,基礎,原型)當老Jquery Mobile



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 

回答

18

我解決了這個由這很可能需要在遙遠的過去一段時間內消除jquery.ui.widget.js,但是現在不是了。

+0

是的我以相同的方式解決了這個問題。感謝您的回答! – GibboK

0

我意識到,加載jQuery UI的庫當問題出現。經過一番挖掘,我發現這兩個庫可能有一些問題。

相關問題