Here is my method to this:
<script>
function games(){
document.write("loading");
$.ajax({
url: "http://allencoded.com/test3.php",
dataType: 'json',
success: function (data) {
var homeTeams = new Array();
for (var i =0; i < data.gms.length; i++){
homeTeams[i]=data.gms[i].h }
}
});
}
</script>
While it works fine. I am just looking for an easier way to do this if it is possible.
I missed the $.ajax call; since you’re using jQuery, you could do this as well: