예, 당신이 요구하는 것은 AJAX 또는 XMLHttpRequest입니다. jQuery와 같은 라이브러리를 사용하여 브라우저 간 호환성 문제로 전화 걸기를 단순화하거나 자체 처리기를 작성할 수 있습니다. jQuery를에
:
$.GET('url.asp', {data: 'here'}, function(data){ /* what to do with the data returned */ })
(W3C)에서 평범한 자바 스크립트 : 외부 페이지를 확인해야하는 경우
var xmlhttp;
function loadXMLDoc(url)
{
xmlhttp=null;
if (window.XMLHttpRequest)
{// code for all new browsers
xmlhttp=new XMLHttpRequest();
}
else if (window.ActiveXObject)
{// code for IE5 and IE6
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
if (xmlhttp!=null)
{
xmlhttp.onreadystatechange=state_Change;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}
else
{
alert("Your browser does not support XMLHTTP.");
}
}
function state_Change()
{
if (xmlhttp.readyState==4)
{// 4 = "loaded"
if (xmlhttp.status==200)
{// 200 = OK
//xmlhttp.data and shtuff
// ...our code here...
}
else
{
alert("Problem retrieving data");
}
}
}
FYI : 자바 스크립트는 동일한 도메인에서만 대화 할 수 있습니다. JSON 호출을 통해 다른 사용자에게 전화를 걸 수 있지만 프록시를 사용하는 것이 좋습니다. – epascarello