일부 JSON이 다시 표시되어 내 페이지에 표시해야하지만 표시되지는 않습니다.JSON 응답을 처리 할 수없는 이유는 무엇입니까?
누군가 제발 내가 잘못 가고있는 것을 볼 수 있는지 확인해 주시겠습니까?
코드 :
$.ajax({ type: "GET",
url: "URL GOES HERE - Cant give for obvious reasons :)",
dataType: "jsonp",
success: function (response) {
var result = response.d;
$.each(result, function (index, res) {
$('#questions').val(res.q);
});
},
error: function (msg) {
}
});
JSON :와
{
"d": [
{
"id": "1002 ",
"q": "What region is Auchentoshan whisky made in",
"a1": "Highlands",
"a2": "Speyside",
"a3": "Lowlands"
},
{
"id": "1042 ",
"q": "Chase’s award winning vodka is made from...",
"a1": "Grapes",
"a2": "Rye",
"a3": "Potatoes"
}
]
}
그래서'을 console.log (응답)'성공 핸들러는 아무것도주지 않는다? – VisioN
페이지의 어떤 요소에 ID가 "질문"입니까? – MrOBrian
왜 "json"대신'datatype : "jsonp"'를 사용하고 있습니까? – jessegavin