PHP头条
热点:

php用ajax为啥只能返回数字


php用ajax为什么只能返回数字

//提交表单
function subm(){
var user = $('#frm').serialize();
$.ajax({
url: 'b.php',
type: 'POST',
data:user,
contentType:"application/json",
dataType: 'json',
async:false,
beforeSend: function(){
alert('Error loading PHP document');
},
success: function(result){
alert(result);
}
});
}



id="user" name="username" />





然后我在b.php页面写一个 echo '123' 回调函数可以执行alert(res) 并输出123 可是我echo写字母字符中文他就没反应了 连框都不弹  我把页面设成utf-8 在 b.php也加了header 可是他应该能返回字母跟字符 就算乱码也会弹个窗吧 是不是那个json传递的问题 求教 分享到: 更多

相关文章

相关频道:

PHP之友评论

今天推荐