Created
March 17, 2013 11:29
-
-
Save Mailaender/5181169 to your computer and use it in GitHub Desktop.
Another failed attempt to get jQuery.getJSON() to work
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>OpenRA Master Server</title> | |
</head> | |
<body> | |
<h1>OpenRA Master Server</h1> | |
<script type="text/javascript" src="jquery-1.9.1.js"></script> | |
<script type="text/javascript"> | |
$.getJSON('list_json.php', function(data) { | |
var items = []; | |
$.each(data, function(key, val) { | |
items.push('<li id="' + key + '">' + val + '</li>'); | |
}); | |
$('<ul/>', { 'class': 'my-new-list', | |
html: items.join('') | |
}).appendTo('body'); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment