성공시 다른 함수를 호출하는 함수가 있습니다. 알 수 있듯이 경고를 사용했으며 경고가 "2"로 올라갑니다.함수가 다른 함수를 호출하지 않습니다.
F12 키를 누르면 500 서버 오류가 발생하지만 XML로 모든 데이터를 올바르게 가져 오는 것을 볼 수 있기 때문에 웹 서비스가 작동하는 것을 볼 수 있습니다. 또한 내 data: param
또는 쿼리 문자열이 올바른 값을 가져옵니다.
자바 스크립트 :
function ContactView()
{
alert("1")
var txtSearchbox = $("#searchTextField").val();
$.ajax({
type: "GET",
data: param = "searchField="+txtSearchbox+"&office="+localStorage.getItem("office")+"&person="+localStorage.getItem("person")+"&user="+localStorage.getItem("user")+"&organization="+localStorage.getItem("organization"),
contentType: "application/json; charset=utf-8",
url: "http://msw-wsdl.company.net/mobile.asmx/ContactGet",
dataType: "json",
success: successContact,
failure: function (msg) {
console.log(msg);
}
});
alert("2") /*this is the last alert that pop's up, nothing further*/
}
/*wsdl call succeed*/
function successContact(data) {
alert("3")
$("#lstView_contacts").kendoMobileListView({
dataSource: JSON.parse(data.d),
template: $("#lstView_contact_Template").html(),
endlessScroll: true,
scrollThreshold: 8
});
window.location = "#contactsview";
}
가 왜 성공 콜백 successContact
가 호출되지 않습니다 - 어떤 아이디어?
'실패'옵션이 없으므로 콘솔에서 "구문 분석 오류"메시지가 표시되지 않는 동일한 원본 정책으로 인해 ** 실패 할 경우 ** 오류로 변경하십시오. – adeneo
@adeneo : 더 나은 오류 응답 -'{ "readyState": 4, "responseText": "{\"Message \ ": \"요청을 처리하는 중 오류가 발생했습니다. \ ", \"StackTrace \ ": 500, "statusText": "내부 서버 오류"} ' – user3458266
500 오류가 해결 될 때까지 절대로 성공할 수 없습니다. \\ "\"\ "\" 서버로 보내고있는 데이터를 점검하여 오류를 생성하는 것이 아니라 서버 측에서 올바르게 사용되도록 형식이 올바른지 확인하십시오. –