I'm trying to get the JSON from this URL into variable
This bit of code successfully puts it in a div element
$("#siteloader").html('<object data="MYURL">');
But I want the contents of that div inside a string variable rather than in the div.
I've also tried the following:
$.ajax({
type : "GET",
dataType : "jsonp",
url : "MYURL", // ?callback=?
success: function(data){
// do stuff with data
}
});
But this shows a syntax error "Uncaught SyntaxError: Unexpected token : " "getfixes:1" in the javascript console when I try it in chrome.
Is it possible for me to just get the contents of a URL as a string in the data variable?