我试图找出如何使用AJAX例如只是显示从PHP特定的响应只显示来自服务器的特定回波响应。我有一个PHP这给下面的响应 -是有可能用ajax
echo 'Success'; //Display only this
//Some other process
echo 'Something else for other process';
JS
$.ajax({
type: "POST",
url: "some.php",
data: {action: 'test'},
dataType:'JSON',
success: function(response){
$('#name_status').html(response);
}
});
只是改变'数据类型: 'JSON''为'数据类型:' HTML'' –