[RE-EDIT] I am trying to pass a value to the server and read from the server using JSONP. I have been able to implement this code:
var record = new Object();
record["deviceID"] = "123";
options = {
url: "http://192.168.2.143:8080/commapi/comaction/init?callback=?",
type: "POST",
data: {dataset: JSON.stringify(record) },
jsonp: "callback",
dataType: "jsonp",
callbackParameter: "jsoncallback",
success: function(result) {
alert(result["retdic.deviceID"]);
},
error: function(XHR, textStatus, errorThrown){
alert("ERROR: " + textStatus);
alert("ERROR: " + errorThrown);
}
};
jQuery.ajax(options);
});
However I receive an invalid label error from FireFox firebug. Could anyone please let me know what it is I am doing wrong? A few examples would be great;y appreciated.
Thanks.
[RE-EDIT] The error produced is:
invalid label
{"ret":"ACK","retdic":{"ak":"Bvr7/ljfj...X212yA+XJR5+AdrmE=","deviceID":"123"}}
The error returned is parseError. I am not sure where I am going wrong. Could anyone give me a hand, please?
Thanks.