Javascript jquery ajax在firefox中失败,但在chrome中正常
下面的javascript无法在firefox中运行test.php,但在chrome中运行ok。Javascript jquery ajax在firefox中失败,但在chrome中正常,javascript,php,jquery,ajax,Javascript,Php,Jquery,Ajax,下面的javascript无法在firefox中运行test.php,但在chrome中运行ok。 如果我使用$.ajax而不是$.post,那么在firefox和chrome中都可以。 原因是什么 < script type = "text/javascript" charset = "utf-8" > $(document).ready(function () { var mail = 'aa@bb.com'; var message = 'hello';
如果我使用$.ajax而不是$.post,那么在firefox和chrome中都可以。
原因是什么
< script type = "text/javascript"
charset = "utf-8" > $(document).ready(function () {
var mail = 'aa@bb.com';
var message = 'hello';
$('#button1').click(function () {
var radiovalue = $(":radio:checked").val();
if (radiovalue == 'yes') {
$.post('test.php', {
a1: mail,
a2: message
},
function (data, status) {
alert("data:" + data + "\nstatus:" + status);
});
};
});
}); < /script>