I'm trying to get the JSON with that example from www.w3schools.com
I just edit de url JSON to "http://www.w3schools.com/jquery/demo_ajax_json.js"
I copied that into my desktop index.html and it doesn't works in local machine. I tried upload it to my web and it doesnt works... Can you help me please?
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
$.getJSON("http://www.w3schools.com/jquery/demo_ajax_json.js",function(result){
$.each(result, function(i, field){
$("div").append(field + " ");
});
});
});
});
</script>
</head>
<body>
<button>Get JSON data</button>
<div></div>
</body>
</html>