2010-12-16 6 views
0

저는 jQuery UI 1.8.7 (대화 상자 위젯 만 포함하는 jQuery UI 사이트에서 생성 된 사용자 정의 빌드)을 사용하고 있습니다.왜 jQuery가 clobber jQuery UI의 유효성을 검사합니까?

또한 jQuery Validate 1.6 플러그인을 사용하고 있습니다.

내 jQuery를 UI 마크 업/코드는 꽤 재고 물건입니다 :

<div id="create-snapshot" title="Create new snapshot?"> 
    <p style="text-align:left"> 
    <span>Name: <input id="snapshotName" name="snapshotName" /></span><br /><br /> 
     <b>Snapshot type:</b><br /><br /> 
     <input type="radio" id="snapshotType" 
       name="snapshotType" value="0" 
       checked="checked" />Snapshot just the disks.<br /> 
     <input type="radio" id="snapshotType" 
       name="snapshotType" value="1" />Snapshot both disks and memory. 
    </p> 
</div> 

$("#create-snapshot").dialog({ 
    autoOpen: false, 
    resizable: false, 
    width: 500, 
    height: 250, 
    modal: true, 
    buttons: { 
    "Create": function() { 
     // ...do ajaxy stuff... 
     $(this).dialog("close"); 
    }, 
    "Cancel": function() { 
     $(this).dialog("close"); 
    } 
    } 
}); 

// Hook up <a href="#" id="create">Create Snapshot</a> 
$("body").delegate("a[id='create']", "click", 
    function() { 
    $("#create-snapshot").dialog('open'); 
    return false; 
    } 
); 

<script> 태그의 순서는 다음과 같습니다

 
jquery-1.4.4.min.js 
jquery-ui-1.8.7.custom.min.js"> 
jquery.validate.min.js 

내가 찾는거야 것은 내가 jquery.validate.min.js을 포함 할 때 죽이는 것입니다 Create Snapshot 이벤트 처리기 제거하면 jQuery 모달 대화 상자가 열립니다.

Firebug/Chrome 개발자 도구에서 오류를 확인했지만 아무 것도 튀어 나오지 않습니다.

왜 이런 일이 발생합니까?

+0

잘 당신이 두 가지를 반대하면 어떻게됩니까? – jcolebrand

+0

@drach - 시도해 보니 아무런 차이가 없습니다. – Kev

+0

그래, 나는 많이 생각했다. idk, 나는 그것을 읽기 전에 아이디어가 부족했다 : S ... 까다로운 버그처럼 들린다. – jcolebrand

답변

1

UPDATE : 버전 1.6에 대해 잠깐 살펴 데, 그것은 (같은 방법으로 이름을 사용) jQuery 라이브러리의 최신 버전의 알려진 버그가, this link을 확인하십시오. 당신은


당신이 검증 플러그인을 업데이트 시도가 유효성 검사 플러그인을 업그레이드해야? 이전 버전의 this plugin을 사용하고 계신지요?

이 코드는 (검증 1.7로) 내 컴퓨터에서 잘 실행 :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
<html> 
    <head> 
     <title></title> 
     <link rel="stylesheet" type="text/css" href="../../css/smoothness/jquery-ui-1.8.7.custom.css"> 
     <script type="text/javascript" src="../../js/jquery-1.4.4.min.js"></script> 
     <script type="text/javascript" src="../../js/jquery-ui-1.8.7.custom.min.js"></script> 
     <script type="text/javascript" src="../../js/jquery.validate.min.js"></script> 
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
     <script type="text/javascript"> 
      $(document).ready(function() { 
       $("#create-snapshot").dialog({ 
        autoOpen: false, 
        resizable: false, 
        width: 500, 
        height: 250, 
        modal: true, 
        buttons: { 
         "Create": function() { 
          // ...do ajaxy stuff... 
          $(this).dialog("close"); 
         }, 
         "Cancel": function() { 
          $(this).dialog("close"); 
         } 
        } 
       }); 

       // Hook up <a href="#" id="create">Create Snapshot</a> 
       $("body").delegate("a[id='create']", "click", function() { 
        $("#create-snapshot").dialog('open'); 
        return false; 
       }); 

      }); 
     </script> 
    </head> 
    <body> 
     <a href="#" id="create">Create Snapshot</a> 
     <div id="create-snapshot" title="Create new snapshot?"> 
      <p style="text-align:left"> 
       <span>Name: <input id="snapshotName" name="snapshotName" /></span><br /><br /> 
       <b>Snapshot type:</b><br /><br /> 
       <input type="radio" id="snapshotType" 
         name="snapshotType" value="0" 
         checked="checked" />Snapshot just the disks.<br /> 
       <input type="radio" id="snapshotType" 
         name="snapshotType" value="1" />Snapshot both disks and memory. 
      </p> 
     </div> 

    </body> 
</html> 
+0

감사합니다 ifaour - 그 치료를했습니다. – Kev

관련 문제