I'm new to js and jQuery, so still very much feeling around ... but this has foxed me for a couple of days.
I am trying to do this 101 thing - to use jQuery.getJson to read and then do something with the file that's over here: http://www.metakarma.org/agame.json
I can't figure out where the error is - in my js or in the file.
Here's what I'm trying in the js:
<script type="text/javascript">
$(document).ready(function () {
$.getJSON("http://www.metakarma.org/agame.json", function (data) {
$.each(data.moves, function (i, amove)
$("#debug").append(amove.role + ' ' + amove.message + '<p>');
});
});
</script>
When I use the js example to get the first 3 cat photos from Flickr on the jQuery reference page over here - http://docs.jquery.com/Getjson - it basically works as expected. But my code/file combo above produces complete silence.
I guess I have 2 questions: 1. how do I efficiently debug this? 2. what is the bug?
Very grateful for pointers out of my current hole! Tony