时间:2021-07-01 10:21:17 帮助过:28人阅读
$.ajax({
url: test.php,
type: 'post',
dataType:'text',
success: function (responseText) {
$('#div1').html(responseText);
$('#div2').html(responseText);
}
});
$res = array(
'div1' => '相关内容',
'div2' => '相关内容',
)
echo json_encode($res);
$.ajax({
url: 'test.php',
type: 'post',
dataType:'json',
success: function (data) {
$('#div1').html(data.div1);
$('#div2').html(data.div2);
}
});
$.post('test.php', {}, function(d) {
for(var i in d) $('#'+i).html(d[i]);
}, 'json');