JSON
Hej EksperterJeg forstår altså ikke hvad jeg gør forkert her http://mikbis.dk/test1/testjson.html
min json fil ser således ud
{
"pictures": [
{
"url": "http://scottgonzalez.com",
"description": "Flot billede"
},
{
"url": "http://scottgonzalez.com",
"description": "Flot billede"
}
]}
og koden således
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Testjason</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
$.getJSON( "http://mikbis.dk/test1/json/pictures.json", function( data ) {
$.each( data, function( key, val ) {
alert("key: "+key);
alert("val: "+val);
alert("test: "+val.pictures.url);
});
});
</script>
</head>
<body>
TEST JSON
</body>
</html>
