2010-07-11 3 views
0

왜이 코드 (jquery UI의 데모 샘플에서 가져옴)가 저에게 효과적이지 않습니까? 그것은 .button()이 함수가 아니라고 말합니다.jquery UI 버튼 오류

업데이트 : Google에서 행운을 시험했습니다. . JQuery와에 대한 경로가있을 수 있습니다처럼 27

http://pastie.org/1039784

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 
<html> 
<head> 
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> 
    <title>Page Title</title> 
    <link rel="stylesheet" href="screen.css" type="text/css" media="screen" title="no title" charset="utf-8" /> 
    <link rel="stylesheet" href="scripts/css/ui-lightness/jquery-ui-1.8.2.custom.css" type="text/css" media="screen" title="no title" charset="utf-8" /> 


    <script type="text/javascript" src="http://www.google.com/jsapi"></script> 
<script type="text/javascript"> 
    google.load("jquery", "1.3.2"); 
    google.load("jqueryui", "1.7.2"); 
</script> 


</head> 
<body> 
    <div id="container" class="container"> 

    <script type="text/javascript"> 
     $(document).ready(function(){ 
       $(".demo button:first").button({ 
      icons: { 
       primary: 'ui-icon-locked' 
      }, 
      text: false 
     }).next().button({ 
      icons: { 
       primary: 'ui-icon-locked' 
      } 
     }).next().button({ 
      icons: { 
       primary: 'ui-icon-gear', 
       secondary: 'ui-icon-triangle-1-s' 
      } 
     }).next().button({ 
      icons: { 
       primary: 'ui-icon-gear', 
       secondary: 'ui-icon-triangle-1-s' 
      }, 
      text: false 
     }); 

     }); 
    </script> 


<div class="demo"> 

    <button>Button with icon only</button> 
    <button>Button with icon on the left</button> 
    <button>Button with two icons</button> 
    <button>Button with two icons and no text</button> 

</div><!-- End demo --> 

    <div> 
     <ul> 
      <li> 
       <a id="icon_only"></a> 
      </li> 
     </ul> 
    </div> 
    </div>    

</body> 
</html> 

답변

0

보이는 버튼이 작동하지 않을 것입니다

라인 : 여기 TEH 오류

$는 (". 첫 번째 데모 버튼")입니다 잘못 입력하면 다음을 시도하십시오.

<script type="text/javascript" src="http://www.google.com/jsapi"></script> 
<script type="text/javascript"> 
    google.load("jquery", "1.3.2"); 
    google.load("jqueryui", "1.7.2"); 
</script> 

jquery 및 jquery를로드해야합니다. ui libs Google 서버에서이 방법으로 잘 작동해야합니다.

+0

네가 옳았 어, 네가 맞았다. 일단 1.4.2와 1.8.2를 얻으면 google로드가 작동했다. 번역. 로컬로로드 할 때 잘못된 점은 무엇입니까? 감사합니다. – badnaam

+0

모르겠다. 그냥 맞지 않았다. P : "js/jquery.js"라고 생각하니? 그때 당신의 js 폴더가 스크립트와 같은 폴더에 있지 않아야합니다. Im glad it worked;) 어쨌든 Google에서 libs를 사용하는 것이 더 좋습니다. 클라이언트의 요청이 병렬로로드가 빨라집니다. –