ajax接json数据php html里面接收的要怎么改

2025-03-23 01:15:36
推荐回答(2个)
回答1:


回答2:

$(form).bind('submit', function(){
    $.ajax(
        {
var thisid = $('input[name=id]').val();
            url: '*.php',
            data:{'id': thisid},
            type: 'post',
            datatype: 'json',
            success:function(data){
            //你的输出代码,类似
                alert(data);
             //json格式其实不能直接alert,必须以 data.键 的方式才能显示值
            }
        }
    )
})