2013-04-12 2 views
0

jquery를 사용하여 일정을 제거하고 숨기는 방법을 알려줄 수 있습니까? 사실 jquery 벨로우와 잘 작동하지만 현재 이벤트를 제거하고 있지만 숨기기 만하면됩니다. 제발 나를 위해 수정할 수 있습니까? jquery를 사용하여 제거하고 숨기는 방법?

function delData(id){ 
    if(confirm('Do you really want to delete it ? if yes then click OK and wait for next notification please.. ')){ 
     $.ajax({ 
      type:'POST', 
      url:'manage_reports.php?action=del&id='+id, 
      success:function(result){ 
       alert('Sale has been deleted successfully.. Do not refresh your page if you want to keep stay here'); 
       $(control).parents('table').eq(0).remove().hide("table"); 
      } 
     });  
    } 
}; 

답변

1

당신은 hide 삭제 된 항목이 당신이 다른 요소를 제거하려면 hide 또는 remove는 다음 개별적으로 그것을 사용할 수 없습니다 정말 고마워요. hide은 전달하려고하는 선택기를 사용하지 않으므로 매개 변수는 사용하지만 선택기는 옵션이 아닙니다.

function delData(id){ 
    if(confirm('Do you really want to delete it ? if yes then click OK and wait for next notification please.. ')){ 
     $.ajax({ 
       type:'POST', 
       url:'manage_reports.php?action=del&id='+id, 
       success:function(result){ 
        alert('Sale has been deleted successfully.. Do not refresh your page if you want to keep stay here'); 
        $(control).parents('table').eq(0).remove(); 
      }}); 
}}; 
+0

'.hide()'는 선택자를 매개 변수로 사용하지 않습니다. '.hide ("table")'대신'.hide()'를 쓰지 않으시겠습니까? –

+0

감사합니다. @ JeffB, 내 대답을 업데이트 해 주셔서 감사합니다. – Adil

+0

죄송합니다 나를 위해 작동하지 않습니다 :( –

0

당신이 그런 후 비활성 그때 내가

을 /를 처음 만들 제안 바인드를 사용하여 해당 이벤트를 바인딩하거나 요소에 사는 것 '마우스 클릭'으로 사건을 의미하는 "이벤트를 제거"말에 의한 경우 아약스 요청은 요소를 제거/숨기기 만하고 .unBind ('event')를 호출합니다.

관련 문제