웹 서비스에서 Json 객체를 가져와야하고 이에 대한 문서를 찾을 수 없습니다. 나는 그것을 얻으려면 SQL 문장을 게시 할 수있다. 이 모든 것이 가능하면 누구나 아는가?Javascript를 사용하여 웹 서비스에서 Json 객체를 가져 오는 방법은 무엇입니까?
답장을 보내 주셔서 감사합니다. 처음에는 웹 서비스에 GetJsonString "metod"가 있습니다. 는 임이 코드를 시도 :
$(document).ready(function() {
$.ajax({
type: 'Get',
url: 'http:********************************.asmx?op=GetJSONString',
success: function(returnedJson) {
alert(returnedJson)
}
});
});
나는이 오류 얻을 :
XMLHttpRequest cannot load http:/***********asmx?op=GetJSONString. Origin null is not allowed by Access-Control-Allow-Origin.
하지만 반환 된 데이터를 어떻게 얻을 수 있습니까? 이거? Thanks – Mikelon85
json struct {name : "john", lastname : "doe"}의 경우 다음을 할 수 있습니다. function success (data) {console.log (data.name, data.lastname); } –