this is my script , i am unable to get the json data from the link , please hep me , point out if i am wrong anywhere , thank u in advance
<script type="text/javascript">
function getsomethin()
//wait for HTML document
{
alert("l");
$.getJSON('http://developers-blog.org/resources/jquery-ajax/heroes-list.json', function (data) {
console.log(data); alert(data);
$.each(data, function (i, name) {
$("div").append(name + " ");
});
});
}
</script>
you have to use JsonP for cross domain Request.
“jsonp”: Loads in a JSON block using JSONP. Adds an extra “?callback=?” to the end of your URL to specify the callback. Disables caching by appending a query string parameter, “_=[TIMESTAMP]”, to the URL unless the cache option is set to true.
try like this