1
을 사용하여 프록시를 사용하는 방법에 문제는 내가 서버에서 응답을 할 때 다음이 null
자바 스크립트
//url of web service
url="http://www.google.com/ig/calculator?hl=en&q=12INR=?GBP"
var xmlHttp=new xmlHttpRequest();
//object of xml request
xmlHttp.open('GET', url, true);
//get method
xmlHttp.onreadystatechange = function(){
try{
if (xmlHttp.readyState != 4)
return;
alert(xmlHttp.responseXML);
var result = xmlHttp.responseXML.documentElement;
var jsonString = result.childNodes[0].nodeValue;
var result1 = jsonParse(jsonString);
alert(result1.rhs);
document.getElementById('results').innerHTML = innerHTML;
}
catch(e1){alert("erroe="+e1);}
};
xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xmlHttp.send(null);
}
내가이 경우에해야 할 다음 무슨 일이 ??? 자세히 설명하십시오 또는 u가 – Blackberry
만든 사람을 비난 ... 서버에서 해당 그래서 내가 얻을 수 responce에 대한 모든 관련 예제를 게시 할 수 있습니다 thy annoyng 같은 원산지 정책. :) 어쨌든 최선의 방법은 대체 계산기 API를 검색하는 것입니다 (예 : google maps에는 AJAx를 사용하지 않고 JSOP를 사용하는 JSONP 자바 스크립트 API가 있습니다). 자신의 서버 대신에 원하는 것을 수행 한 다음 결과를 반환하십시오. – hugomg
이 문제의 해결책이 아닙니다.이 웹 서비스는 jquery가 아닌 다른 자바 스크립트 사용법을 사용해야합니다. – Blackberry