i am using xampp to test localhost, parsing a json file.
when i point to an external json file i get an error in httpfox NS_ERROR_DOM_BAD_URI.
when the json file is local or pointed thru localhost everything works fine.
when the same external reference method is placed in my godaddy server it works fine.
why does localhost not accept the external json url?
Code:
$(document).ready(function(){
//var url='data.json';//works on everywhere
//var url='http://localhost/data.json';// works localhost
var url='http://www.myurl.com/data.json';//localhost error, only works on live server
$.getJSON(url, function(data){
$.each(data.data, function(i, entry) {
$("p:last").append(entry.img + '<br/>');
});
});
});
Bookmarks