malformed JSON while JSON is valid? malformed JSON while JSON is valid? json json

malformed JSON while JSON is valid?


<script> $(document).ready(function() {    $.getJSON("employe.json", function(data) {    document.write(data.employees[0].firstName);    }); });</script>

Or instead of document write

 alert( data.employees[0].firstName);

Odds are you are going to want $.each iteration

 <script> $(document).ready(function() {    $.getJSON("employe.json", function(data) {      $.each(data.employees, function(arrayID, employee) {            alert(employee.firstName);      });    }); });</script>