http://mbranko.github.io/webkurs
Ovo je deo web kursa
null
NaN
ili Infinity
null
true
false
{
i }
,
:
{
"name": "Jack B. Nimble",
"at large": true,
"grade": "A",
"level": 3,
"format": {
"type": "rect",
"width": 1920,
"height": 1080,
"interlace": false,
"framerate": 24
}
}
{"name":"Jack B. Nimble","at large": true,"grade":"A","level":3, "format":{"type":
"rect","width":1920, "height":1080,"interlace":false, "framerate":24}}
[
i ]
,
["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
[
[0, -1, 0],
[1, 0, 0],
[0, 0, 1]
]
application/json
<html>...
<script>
var data = { ... JSONdata ... };
</script>...
</html>
XMLHttpRequest
responseText
responseText
responseData = eval('(' + responseText + ')');
// ili
responseData = responseText.parseJSON();
eval
sa XMLHttpRequest
?eval
-uiranje tih podataka nije manje bezbedno od originalnog HTML-astring.parseJSON()
umesto eval
title
sa različitim značenjem
<section>
<title>Book-Signing Event</title>
<signing>
<author title="Mr" name="Vikram Seth" />
<book title="A Suitable Boy" price="$22.95" />
</signing>
<signing>
<author title="Dr" name="Oliver Sacks" />
<book title="The Island of the Color-Blind" price="$12.95" />
</signing>
</section>
section.title
section.signing[0].author.title
section.signing[1].book.title
{"section":
"title": "Book-Signing Event",
"signing": [
{
"author": { "title": "Mr", "name": "Vikram Seth" },
"book": { "title": "A Suitable Boy",
"price": "$22.95" }
}, {
"author": { "title": "Dr", "name": "Oliver Sacks" },
"book": { "title": "The Island of the Color-Blind",
"price": "$12.95" }
}
]
}}
<![CDATA[ ... ]]>