Ajax帖子在IE11on Windows 8中无效,没有返回错误

时间:2016-06-18 14:15:03

标签: javascript php jquery ajax internet-explorer

相同的代码在mac上使用chrome:

$.ajax({
        url     : 'change.php',
        method  : 'POST',
        data    : {"id" : id, 'name': name},
        success : function( response ) {
            alert(response)
        }
    });

未显示任何提示。我假设它不成功。有什么想法吗?

更新

开发人员的控制台中没有显示错误

1 个答案:

答案 0 :(得分:-1)

试试这个:

test.php的

<?php
    print_r($_POST);
?>

的index.html

<script   src="jquery-3.0.0.js"></script>
<script>
var p1=1;
var p2 = 23;
$.ajax({
        url     : "test.php",
        method  : "POST",
        data    : {param1:p1,param2:p2},
        success : function( response ) {
            console.log(response);
            alert(response);
        }
    });
</script>