JSONP alert parsererror

oFFScull

New Member
\[code\]$.ajax({ type: "GET", dataType: "jsonp", jsonpCallback: "jsoncallback", //async: false , data: { // some data here }, url: "http://mydomain.com/checkRequest.php", success: function(data){ alert("123"); alert(data.data.NameA); }, error: function(jqXHR, textStatus){ alert("Request failed: " + textStatus); }});// end of ajax\[/code\]I can get the following string from the URL below, \[code\]([{ "data": { "Rate": "", "RoleA": "Student", "NameA": "studentD", "RoleB": "Tutor", "NameB": "tutorB", "Give": "0", "Get": "1", "Accept": "0", "RateCounter": "" } }]);\[/code\]\[code\]http://mydomain.com/checkRequest.php?callback=jsoncallback&nameB=tutorB&roleB=Tutor&get=1&roleA=Student&nameA=studentD&give=0&_=1364082750444\[/code\]however, it alerts \[code\]parsererror\[/code\]. May I ask where's going wrong?If I delete \[code\]jsonpCallback: "jsoncallback",\[/code\] and change \[code\]URL\[/code\] to url: \[code\]"http://mydomain.com/checkRequest.php?jsoncallback=?",\[/code\] there is no parsererror, but it does not able to \[code\]alert(data.data.NameA);\[/code\]
 
Back
Top