What am I doing wrong here? why writeQuestions
doesn't run on-load (not onclick..)?
$(document).ready(function() {
$.getJSON("JavaScript/questions.json", function(data) {questions = data;});
$("#start").one("click" , writeQuestions);
writeQuestions();
});
(the .one()
line is commented out in my code)
When i do this:window.onload=writeQuestions;
it works fine..