其实我应该在浏览器中显示JSON数据,到目前为止我在浏览器响应正文中获取数据,但这里是问题所在。我面对的是无法在浏览器中显示它的图片以便更好地理解,任何人都可以帮助我。提前致谢。如何从浏览器响应头显示json数据
HTML代码:
Demoresults appended here:
$(document).ready(function() {
$("#testbutton").click(function() {
$.ajax({
url: 'http://localhost:8080/SMWS/Rest/parentService/parent/getSchoolDetails',
dataType: 'jsonp',
success: function(data) {
$("#results").append('all good');
alert(JSON.stringify(data));
},
error: function() {
$("#results").append("error");
alert('error');
}
});
});
});
2015-12-17
venkat
+0
你得到警报 –
+0
不,我没有得到警报 –
+0
没有你试过'的console.log(数据[ 0]);'成功 –