2010-08-21 6 views
2

저는 ZfDebug (http://code.google.com/p/zfdebug/) 및 플러그인 Base64 인 코드/디코드가있는 Zend Framework를 사용합니다. 내가 만들려고 할 때 (http://plugins.jquery.com/project/base64)ZFdebug Jquery interference

문제는 다음과 같습니다

$(document).ready(function(){ 

$('#submit').click(function(e){ 
    e.preventDefault(); 
    data = $.base64Encode("something"); 
alert(data); 
}); 

});

오류가 나타납니다 : 소스에 ZfDebug을 넣은 경우 $ .base64Encode 함수

없는 스크립트

#ZFDebug_debug { font: 11px/1.4em Lucida Grande, Lucida Sans Unicode, sans-serif; position:fixed; bottom:5px; left:5px; color:#000; z-index: 255;} 
      #ZFDebug_debug ol {margin:10px 0px; padding:0 25px} 
      #ZFDebug_debug li {margin:0 0 10px 0;} 
      #ZFDebug_debug .clickable {cursor:pointer} 
      #ZFDebug_toggler { font-weight:bold; background:#BFBFBF; } 
      .ZFDebug_span { border: 1px solid #999; border-right:0px; background:#DFDFDF; padding: 5px 5px; } 
      .ZFDebug_last { border: 1px solid #999; } 
      .ZFDebug_panel { text-align:left; position:absolute;bottom:21px;width:600px; max-height:400px; overflow:auto; display:none; background:#E8E8E8; padding:5px; border: 1px solid #999; } 
      .ZFDebug_panel .pre {font: 11px/1.4em Monaco, Lucida Console, monospace; margin:0 0 0 22px} 
      #ZFDebug_exception { border:1px solid #CD0A0A;display: block; } 
     </style> 
     <script type="text/javascript" charset="utf-8"> 
      if (typeof jQuery == "undefined") { 
       var scriptObj = document.createElement("script"); 
       scriptObj.src = "http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"; 
       scriptObj.type = "text/javascript"; 
       var head=document.getElementsByTagName("head")[0]; 
       head.insertBefore(scriptObj,head.firstChild); 
      } 

      var ZFDebugLoad = window.onload; 
      window.onload = function(){ 
       if (ZFDebugLoad) { 
        //ZFDebugLoad(); 
       } 
       jQuery.noConflict(); 
       ZFDebugCollapsed(); 
      }; 

      function ZFDebugCollapsed() { 
       if (0 == 1) { 
        ZFDebugPanel(); 
        jQuery("#ZFDebug_toggler").html("&#187;"); 
        return jQuery("#ZFDebug_debug").css("left", "-"+parseInt(jQuery("#ZFDebug_debug").outerWidth()-jQuery("#ZFDebug_toggler").outerWidth()+1)+"px"); 
       } 
      } 

      function ZFDebugPanel(name) { 
       jQuery(".ZFDebug_panel").each(function(i){ 
        if(jQuery(this).css("display") == "block") { 
         jQuery(this).slideUp(); 
        } else { 
         if (jQuery(this).attr("id") == name) 
          jQuery(this).slideDown(); 
         else 
          jQuery(this).slideUp(); 
        } 
       }); 
      } 

      function ZFDebugSlideBar() { 
       if (jQuery("#ZFDebug_debug").position().left > 0) { 
        document.cookie = "ZFDebugCollapsed=1;expires=;path=/"; 
        ZFDebugPanel(); 
        jQuery("#ZFDebug_toggler").html("&#187;"); 
        return jQuery("#ZFDebug_debug").animate({left:"-"+parseInt(jQuery("#ZFDebug_debug").outerWidth()-jQuery("#ZFDebug_toggler").outerWidth()+1)+"px"}, "normal", "swing"); 
       } else { 
        document.cookie = "ZFDebugCollapsed=0;expires=;path=/"; 
        jQuery("#ZFDebug_toggler").html("&#171;"); 
        return jQuery("#ZFDebug_debug").animate({left:"5px"}, "normal", "swing"); 
       } 
      } 

      function ZFDebugToggleElement(name, whenHidden, whenVisible){ 
       if(jQuery(name).css("display")=="none"){ 
        jQuery(whenVisible).show(); 
        jQuery(whenHidden).hide(); 
       } else { 
        jQuery(whenVisible).hide(); 
        jQuery(whenHidden).show(); 
       } 
       jQuery(name).slideToggle(); 
      } 
     </script> 

을 포함하고도에서 <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'></script>

이 내 html의 head 요소는 서로 간섭합니다. (Jquery가 두 번로드됩니다.)
개발에서 프로덕션으로 응용 프로그램을 설정하면 생성 된 ZfDebug 스크립트가 표시되지 않고 jquery 호출이 정상적으로 작동합니다.
하지만 Jquery를 사용할 수 있으려면 개발 모드에서 사용할 수 있어야합니다.

+2

슬프게도,이 서로 다른 jQuery를 플러그인으로, 여러 번보고 된 ZFDebug 버그입니다. – takeshin

답변

0

ZFDebug (현재 트렁크에 있음)의 최신 버전은 jQuery에 의존하지 않으며 자바 스크립트 포함을 방해하지 않습니다.

편집 : 최근 ZFDebug 더 나은 지역 사회 지원을 위해 GitHub의에 이동은 : http://github.com/jokkedk/zfdebug