2011-04-27 5 views
0

를 사용하는 경우 양식을 다음JQuery와 응답 아약스

$.ajax({ 
    url: url_string, 

    //GET method is used 
    type: "POST", 

    //pass the data   
    data: data_string, 

    //Do not cache the page 
    cache: false, 

    //success 
    success: function (html) { 
     //if process.php returned 1/true (send mail success) 
     if (html != "") { 
      //hide the form 
      $('.form').fadeOut('slow'); 

      // here the function is not working... 

      $(function() { 
       $("#tabmenu").tabs("#content", { 
        effect: 'ajax', 
        current: 'active', 
        initialIndex: 1 
       }); 
      });  
     } else { 
      alert('Sorry, unexpected error. Please try again later.'); 
      return false; 
     } 
    } 
}); 
+2

AJAX 처리기의 DOM 준비 함수에서 물건을 포장 할 필요가 없습니다. – ThiefMaster

답변

1
$(function() { 
$("#tabmenu").tabs("#content", { 
    effect: 'ajax', 
    current: 'active', 
    initialIndex: 1 
}); 
}); 

아래 그것보다 그에서 코드를 변경 JQuery와 탭을 또한 다른 탭을 선택 페이드 아웃하면 다른 탭을 선택하는 방법.

$("#tabmenu").tabs("#content", { 
    effect: 'ajax', 
    current: 'active', 
    initialIndex: 1 
}); 

지금 바로 DOM이로드되기 때문에 탭을 실행할 수 없습니다.

+0

여전히 작동하지 않습니다 – Jignesh

+0

Firefox & Firebug가 설치되어 있습니까? 또는 Javascript 오류를 볼 다른 뭔가가, 당신이지고있다? 게시 해주세요. – wegginho