I'm talking to a server and the JSON response looks like this:
someResponse({ "Response":{"status":"3","message":"Not valid bla bla"} });
Proper JSON should look like this, right?:
{
"response":
{
"status":"3",
"message":"Not valid bla bla"
}
}
Is there a way I could somehow reach that data with jQuery if enclosed in that "someResponse" function?
My jQuery code looks like this:
$.ajax({
url: "https://someurl/test/request.asp?user=x&pass=x",
dataType: "JSONP",
success: function(msg){
$("#json_here").html(msg.response.status);
},
error:function(x,e){alert(x+" :: "+e)}
});
Of course, nothing happens when I do that. But if i do $("#json_here").html(msg); then I ges the full response as above.
Am I doing something wrong or is this an invalid way of sending JSON data? I'm not getting parse errors.
Thanks in advance.