wordpress blog에서 JSON 데이터를 검색하려고합니다. JSON API 플러그인을 사용하여 JSON 객체를 가져 왔습니다.Phonegap 프로젝트 용 javascript에서 json 데이터를 다시 작성
제 코드를 확인하십시오. 오류 상태 0을 표시합니다. 데이터를 검색 할 수 없습니다.
var xmlhttp;
window.onload = function(){
document.addEventListener("deviceready",init,false);
}
function init(){
xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET","http://www.foduu.com/api/get_recent_posts/", false);
xmlhttp.send();
xmlhttp.onreadystatechange = dataReturn;
}
function dataReturn(){
if(xmlhttp.readyState==4 && xmlhttp.status == 200){
var jsonResponse = xmlhttp.responseText;
jsonResponse = eval("("+jsonResponse+")")
alert("jsonResponse.count_total");
}
else
{
alert("could not connect and Status:" + xmlhttp.status);
}
}
제발 도와주세요.
미리 감사드립니다.
나는 이것을 phonegap에서 사용할 수 있습니까? – user3201500