jquery ajaxリクエストを使用して別のマシンのコントローラーからデータを取得しようとしています:
var url = 'http://192.168.1.206/publish' + '/Home/GetStudentById/';
var datas = 'studentId=' + 13;
$.ajax({
type: 'POST',
url: url,
async: false,
data: datas,
crossDomain: false,
jsonpCallback: 'jsonCallback',
contentType: "application/json",
dataType: 'jsonp',
error: function (data) {
alert('bad');
},
success: function (data) {
alert('good');
},
complete: function (data) {
debugger;
alert('foo');
}
});
データとともに返されますが、常にこのエラーが発生しますSyntax Error: invalid label
そしてjsonの結果は次のようになります:
{"Student0":{"StudentID":"13","RegisterationNo":"125426","FullName":"mohamed bader mohamed bader","ClassName":"First Primary","ClassroomName":"1/5","Phone":"11212","CivilID":"153641789","CurrentClassID":"4","CurrentYearID":"1"},"Student1":{"StudentID":"13","RegisterationNo":"125426","FullName":"mohamed bader mohamed bader","ClassName":"First Primary","ClassroomName":"1/2","Phone":"11212","CivilID":"153641789","CurrentClassID":"4","CurrentYearID":""},"Student2":{"StudentID":"13","RegisterationNo":"125426","FullName":"mohamed bader mohamed bader","ClassName":"First Primary","ClassroomName":"1/3","Phone":"11212","CivilID":"153641789","CurrentClassID":"4","CurrentYearID":""},"Student3":{"StudentID":"13","RegisterationNo":"125426","FullName":"mohamed bader mohamed bader","ClassName":"First Primary","ClassroomName":"1/4","Phone":"11212","CivilID":"153641789","CurrentClassID":"4","CurrentYearID":""},"Student4":{"StudentID":"13","RegisterationNo":"125426","FullName":"mohamed bader mohamed bader","ClassName":"First Primary","ClassroomName":"1","Phone":"11212","CivilID":"153641789","CurrentClassID":"4","CurrentYearID":""}}