Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery SyntaxError:解析json响应的标签无效_Jquery_Json_Web Services_Rest - Fatal编程技术网

Jquery SyntaxError:解析json响应的标签无效

Jquery SyntaxError:解析json响应的标签无效,jquery,json,web-services,rest,Jquery,Json,Web Services,Rest,我从我的WS-request从jquery中得到这个响应 { "SkyWinResponse": { "statuscode": 0, "message": "ok\n ", "rowsaffected": 1, "results": { "result": { "@xsi.type": "member", "accountCreditL

我从我的WS-request从jquery中得到这个响应

{
    "SkyWinResponse": {
        "statuscode": 0,
        "message": "ok\n ",
        "rowsaffected": 1,
        "results": {
            "result": {
                "@xsi.type": "member",
                "accountCreditLimit": 0,
                "accountNo": 1000001,
                "address1": "Annavägen 10",
                "addressChangeDate": "2013-04-12",
                "balance": 2068,
                "balanceCurrency": "kr",
                "certificateText": "PK",
                "climateCompensate": 2,
                "club": "UFK",
                "contactName": "Last, Andreas",
                "contactPhone": "090-123456",
                "countryCode": "SE",
                "countryNameLocalized": "Sverige",
                "createdDate": "2013-04-11",
                "credit": false,
                "dateOfBirth": "1971-05-04",
                "emailAddress": "first.last@ufk.nu",
                "firstJumpDate": "2013-04-27",
                "firstName": "First",
                "gender": "M",
                "hideAccountInRequest": false,
                "honorary": false,
                "infoViaEmail": true,
                "instructorText": "HL HM KL",
                "internalNo": 1,
                "jumpNo": 0,
                "lastName": "Nylund",
                "lastUpd": "2013-05-18 15:58:23.0",
                "licenseType": "C",
                "markedForLabel": false,
                "memberList": false,
                "memberListOverride": true,
                "memberNo": 20878,
                "memberType": "M",
                "nationalityCode": "SE",
                "nationalityNameLocalized": "Sverige",
                "permanentCredit": false,
                "pilot": false,
                "postCode": 91342,
                "postTown": "Obbola",
                "studentJumpNo": 0,
                "supporter": false,
                "userId": "Linda",
                "verifiedLicense": true,
                "video": false,
                "weight": 100,
                "weightUnit": "kg",
                "year": 2013
            }
        }
    }
}
但当我试图解析它时,我只得到了无效的标签。任何关于如何读取每个条目:值并在html页面中显示它们的建议

这是我试图运行的代码

$(文档).ready(函数(){ $.ajax({ url:“”, 数据类型:“jsonp”, 成功:函数(SkyWinResponse){ $.each(data.SkyWinResponse.results.result,函数(i,项) { $(“#响应”)。追加(i+”:“+item+”
”; }); } }); })
您的JSON似乎是有效的。您是否正在尝试这样做:

 $.each(data.SkyWinResponse.results.result, function(i, item)
 {
     $('#response').append(i + " : " + item + "<br>");
 });
$.each(data.SkyWinResponse.results.result,函数(i,项)
{
$(“#响应”)。追加(i+”:“+item+”
”; });

你能展示一下代码的使用效果吗?我是从控制台的调试中得到的。试着将
函数(SkyWinResponse)
更改为
函数(数据)
发布一个指向JSFIDLE或类似工具的链接,这样我就可以帮你了OK,所以这里的问题是为了遵守跨域策略,你使用了jsonp,但是web服务正在返回json数据。因此,如果您可以修改web服务或在同一域上获取请求页面,这将是一个开始