$ .post无效。没有显示错误

时间:2016-01-04 07:11:17

标签: php

function confirm_reg(id){
    if(confirm("Are you sure want to complete")){
       $('#'+id).hide(500);
       $.post(
          'sample.php',
          {id6:id},
          function(data){
           alert(data);
          }
       );   
    }
}

sample.php

echo "something";

firebug控制台中没有显示任何错误。甚至隐藏功能都有效。但发布不起作用!

1 个答案:

答案 0 :(得分:0)

尝试以下方法:

$.ajax({
    type: "POST",
    url: url,
    data: data, //Data to be sent to server.
    success: function(data) {
    },
    dataType: dataType //Type of data you are expecting from server such as xml, json, html, etc
});