2011-11-29 4 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 $ ('#의 fancyClock') tzineClock(). }); – Nagarajan

+0

여기에 전화하시는 중 – Nagarajan

답변

4

이것은 jQuery가 아직 tzineClock 함수를로드하지 않아 "지원되지 않음"일 가능성이 높습니다.

플러그인을 참조 할 스크립트 태그를 확인하고 앞에, jQuery보다 tzineClock 스크립트 태그가 나타나는지 확인하십시오. 이 차이가 없습니다 경우

당신은 우리에게 라인파일 오류를 일으키는을주고 실제로 브라우저 개발자 도구를 사용하여로드 된 스크립트 파일을 보장 할 수 있습니다.

+0

올바른지, 순서는'$ .fn.tzineClock = function (opts) {/ * ... * /}'다음에'$ (document) .ready (function() {$ ('# fancyClock') .tzineClock();});' –

관련 문제