0

i am trying to use jquery form submission with CI but i am unable to get return value from php file.

     $(document).ready(function($){
      $("#submit_btn").click(function(){

    var response = $.ajax({
        type: "POST",
        url: "send_email.php",
        data: $(commentForm).serialize()
    }).responseText;

.......
    here i want to get value return from PHP so that i can print that value
     like bellow
    .......
  $('#commentForm').html('<h5>Thanks</h5>'+here is result from php);
    return false;
});  

});

4

1 回答 1

1

ajax完成后显示消息

$.ajax({
    type: "POST",
    url: "send_email.php",
    data: $(commentForm).serialize()
}).done(function( msg ) {
   $('#commentForm').html('<h5>Thanks</h5>'+msg);
   return false;
});
于 2013-09-02T17:39:52.253 回答