As the title says, Im calling a Json and It's "working", but i'm getting an error from jquery. "cannot read property "length" of undefined". I dont know what it could be.
here is my html, js and json
http://jsfiddle.net/vitorboccio/7LUCa/
<div class="wrapper">
<div class="profile">
<table id="userdata" border="2">
<thead>
<th>Name</th>
<th>E-mail</th>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
JS:
$.ajax({
get: 'people.json',
success: function (data) {
alert('it works');
$.each(data.table, function(i, f) {
var tblRow = "<tr>" + "<td>" + f.name + "</td>" +
"<td>" + f.email + "</td>" + "</tr>"
$(tblRow).appendTo("#userdata tbody");
});
},
error: function() {alert('it doesnt work')},
datatype: 'jsonp'
});
update: