2011-11-29 6 views
2

私はjQueryプラグインtzineClockを持っています。しかし、私がそれを呼び出すときにjquery関数がサポートされていません

$(document).ready(function(){ 
    /* This code is executed after the DOM has been completely loaded */ 
    $('#fancyClock').tzineClock(); 
}); 

"この機能はサポートされていません"というエラーが発生しています。エラーの内容を教えてもらえますか?ここでtzineClockコードは次のとおりです。

$.fn.tzineClock = function(opts){ 

     // "this" contains the elements that were selected when calling the plugin: $('elements').tzineClock(); 
     // If the selector returned more than one element, use the first one: 

     var container = this.eq(0);  
     if(!container) 
     { 
      try{ 
       console.log("Invalid selector!"); 
      } catch(e){} 

      return false; 
     } 

     if(!opts) opts = {}; 

     var defaults = { 
      /* Additional options will be added in future versions of the plugin. */ 
     }; 

     /* Merging the provided options with the default ones (will be used in future versions of the plugin): */ 
     $.each(defaults,function(k,v){ 
      opts[k] = opts[k] || defaults[k]; 
     }) 

     // Calling the setUp function and passing the container, 
     // will be available to the setUp function as "this": 
     setUp.call(container); 

     return this; 
    } 
+0

どの機能がありますか? tzineClockを呼び出そうとしていますか?それを呼び出すコードを表示できますか? – Rup

+0

$(ドキュメント).ready(関数(){ \t /このコードは、DOMの後に実行される*完全にロードされている*/ \t $( '#1 fancyClock')tzineClock(); })。 – Nagarajan

+0

ここでしか電話していません – Nagarajan

答えて

4

jQueryのtzineClock機能をロードするためにまだ持っているので、それは、「サポートされていない」されているため、これがそうです。

プラグインを参照しているスクリプトタグを確認して、の前にtzineClockスクリプトタグが表示されていることを確認してから、のjQueryを呼び出してください。これは違いはありません場合は

あなたは私たちにラインファイルエラーの原因となっているを与え、実際には、ブラウザの開発者向けツールのいずれかを使用してロードされたスクリプトファイルを確保することができます。

+0

これは正しいです。順序は '$ .fn.tzineClock = function(opts){/ * ... * /}'の後に '$(document).ready(function(){$( '#fancyClock' ).tzineClock();}); ' –

関連する問題