hi,
I am sooo close to getting my project done,
I can now output a town name, using Jquery to output mySQL as JSON
the only problem I have now... In my code I have [16] which = 'Andover'
Is there a way to output my whole array? can I use .each()? if so, where?
thanks
here is my code
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<script src="http://code.jquery.com/jquery-1.4.4.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function () {
$.getJSON('json.php', function(data){
$("#content").html(data[16].Town);
});
});
</script>
</head>
<body>
<div id="content"></div>
</body>
</html>
http://www.mypubspace.com/dashtest/newjson.html