Answer the question
In order to leave comments, you need to log in
Why doesn't $.getJSON work?
The index.html header has this:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="js.js"></script>
(function() {
$(document).ready(function(){
$.getJSON('data.json', function(json) {
console.log(json);
});
});
})();
Answer the question
In order to leave comments, you need to log in
such requests work only on the server, if you just run it on a computer without a server, it will not work, as far as I remember...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question