2013-08-08 2 views
0

누구나 dojo.io.script를 사용하여 휴식 서비스를 호출하는 방법을 알려줄 수 있습니까?도장을 사용하여 서비스 전화를 거는 방법은 무엇입니까?

try { 
    dojo.io.script.get({ 
    url: "http://search.twitter.com/search.json", 
    content: { 
     q: "#dojo" 
    }, 
    callbackParamName: "callback" 
    }).then(function(data) { 

    }); 
} catch (e) { 
    alert(e); 
} 

위의 코드를 사용해 보았지만 응답을받지 못했습니다. 무엇이 문제 일 수 있습니까?

답변

1

아래처럼 HTTP GET을 호출 할 수 있습니다

// The "xhrGet" method executing an HTTP GET 
dojo.xhrGet({ 
    // The URL to request 
    url: "get-message.php", 
    // The method that handles the request's successful result 
    // Handle the response any way you'd like! 
    load: function(result) { 
     alert("The message is: " + result); 
    } 
}); 

자세한 내용은 여기 documentation을 확인합니다.

또 다른 예는 here입니다.

관련 문제