我有一个返回 JSON 的 ASP.NET 网络服务。现在,我想使用 jQuery 调用这个 web 服务,然后循环查看结果。但是怎么做?
我现在有这个:
jQuery.support.cors = true;
$().ready(function () {
$.ajax({
type: "GET",
url: "http://www.wunderwedding.com/weddingservice.svc/api/?t=1&cid=1&pid=6&lat=52&lng=5&d=10000&city=nijmegen&field1=0&field2=0&field3=0&field4=0&hasphoto=0&hasvideo=0&minrating=0&lang=nl",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
// Hide the fake progress indicator graphic.
$('#mytest').removeClass('loading');
alert(msg.d);
// Insert the returned HTML into the <div>.
$('#mytest').html(msg.d);
}
});