I have a requirement in which i need to get the content generated in a particular url (which is in JSON). I need to assign this output to my json object after my jQuery ajax call.I've tried this by using the following code, but not yeilding any result (always getting null within the success function parameter).
My Jquery ajax call code is as follows,
$.ajax({
type: "GET",
url: "http://some url",
data : {},
dataType: "json",
contentType: "application/json; charset=utf-8",
success: function (obj) {
alert(obj);
var test = eval("(" + obj + ")");
alert(test);
},
error: function () {
alert("error");
}
})
Is there any error in my request? If this is not the right method please do suggest a method for my situation.