2014-01-08 2 views
0

이 코드에는 레코드를 삭제하고 삭제할 때 애니메이션이있는 ajax 스크립트가 있습니다. 그러나 플러그인으로 ajax 스크립트를 혼합하면 작동하지 않는 것으로 확인됩니다. 이 스크립트의 문제점은 무엇입니까?아약스가 작동하지 않는 플러그인

내 테이블 레코드의 삭제 버튼입니다. 확인과

<?php 
echo' <tr class="record"> 
    <td align="center"><a href="#" id="'.$row["counter"].'" class="delbutton"><img src="images/del.png"></a></td></tr>'; 
?> 

아약스 플러그인

<script> 
     $(function() { 
     $(".delbutton").click(function(){ 
      var element = $(this); 
      var del_id = element.attr("id"); 
      var info = 'id=' + del_id; 
      $(function() { 
    $("<div />").attr("id", "dialog-confirm").append(
     $("<p />").text('Are you sure?').css("text-align", "center").prepend(
      $("<span />").addClass("ui-icon ui-icon-alert").css({ 
       display: 'inline-block', 
       margin: '0px 7px 0px 0px' 
      }) 
     ) 
    ).dialog({ 
        resizable: false, 
        height:140, 
        modal: true, 
        buttons: { 
        "Delete all items": function() {       
         $.ajax({ 
         type: "GET", 
         url: "delete.php", 
         data: info, 
         success: function(){ 
          $(this).parents(".record").animate({ backgroundColor: "#fbc7c7" }, "fast").animate({ opacity: "hide" }, "slow"); 
         } 
         }); 
         $(this).dialog("close"); 
        }, 
        Cancel: function() { 
         $(this).dialog("close"); 
         return false; 
        } 
        } 
       }); // end Dialog   
      return false; 
     }); // end .delbtn 
     }); 
    }); // end jquery load 
    </script> 
+0

어디이'

관련 문제