0
에서 내가 코드다른 결과 요청 JSON은 PHP
var url = 'http://ip.jsontest.com/';
$.ajax({
url: url,
dataType: "jsonp",
async: false,
success: function (result) {
alert('success');
},
error: function (request,error) {
alert(error);
}
});
에게 그 코드 수율 '성공'을 작업했다. 나는이 PHP 코드
<?php
header('Content-Type: application/json; charset=utf-8');
$iii = array('ip' => '114.79.28.24');
echo json_encode($iii);
?>
와 'http://example.com'에 JSON의 URL (http://ip.jsontest.com/)을 변경할 때 나는 오류
어떤 문제가있어?
무슨 오류? –
'jsonp' <>'json'. –
여기에 : http://stackoverflow.com/questions/2887209/what-are-the-differences-between-json-and-jsonp – Hardy