I've been googling this, found recommendations but I couldn't apply correctly. I am calling a json API from other domain so i used jsonp. Please check my code.
$(document).ready(function () {
$("#btnSubmit").click(function () {
GetParam(function (data) {
alert(data.toString());
});
});
});
function GetParam(func) {
$.getJSON("http://test.com/api/getparams.ashx?callback=?", function (result) {});
}
It is able to call the API and show the result. It's just that there is this semicolon issue.
From what i have researched, they say i should return a jsonp format but how can i do that? Note: I don't have access to the source code of the API.
Thanks.