- Luck Dragon: Asszociációs játék. :)
- sziku69: Fűzzük össze a szavakat :)
- gban: Ingyen kellene, de tegnapra
- D1Rect: Nagy "hülyétkapokazapróktól" topik
- GAI: A hűtőpaszta és thermal gap pad ellenes Vaterás
- MasterDeeJay: RAM gondolatok: Mennyi a minimum? DDR3 is jó?
- Geri Bátyó: Agglegénykonyha 13 – Néhány egyszerű, de finom étel
- total90: SSD és HDD árak 2026-ban – most kell vásárolni, vagy várni 2028-ig?
- Elektromos rásegítésű kerékpárok
- Luck Dragon: Alza kuponok – aktuális kedvezmények, tippek és tapasztalatok (külön igényre)
-
LOGOUT
JavaScript != Java (A JavaScript nem összekeverendő a Javával, két különböző programozási nyelvről van szó!)
Új hozzászólás Aktív témák
-
Sk8erPeter
nagyúr
Szívesen!

Innen érthető meg elég jól, mit is csinál a JSON.parse(), lényegében hasonló az eval()-hoz, csak az a nagy különbség, hogy a JSON.parse() nem engedi lefutni pl. az esetlegesen kártékony JavaScript-kódot. Az eval()-nak pedig épp ez a nagy veszélye, hogy rajta keresztül lefuthatnak a rosszindulatú kódok.
Idézet:
"To convert a JSON text into an object, you can use the eval() function. eval() invokes the JavaScript compiler. Since JSON is a proper subset of JavaScript, the compiler will correctly parse the text and produce an object structure. The text must be wrapped in parens to avoid tripping on an ambiguity in JavaScript's syntax.
var myObject = eval('(' + myJSONtext + ')');The eval function is very fast. However, it can compile and execute any JavaScript program, so there can be security issues. The use of eval is indicated when the source is trusted and competent. It is much safer to use a JSON parser. In web applications over XMLHttpRequest, communication is permitted only to the same origin that provide that page, so it is trusted. But it might not be competent. If the server is not rigorous in its JSON encoding, or if it does not scrupulously validate all of its inputs, then it could deliver invalid JSON text that could be carrying dangerous script. The eval function would execute the script, unleashing its malice.
To defend against this, a JSON parser should be used. A JSON parser will recognize only JSON text, rejecting all scripts. In browsers that provide native JSON support, JSON parsers are also much faster than eval. It is expected that native JSON support will be included in the next ECMAScript standard.
var myObject = JSON.parse(myJSONtext, reviver);"
Új hozzászólás Aktív témák
- iPhone topik
- Diablo II: Classic és Resurrected
- Luck Dragon: Asszociációs játék. :)
- Abarth, Alfa Romeo, Fiat, Lancia topik
- Ez vár ránk a Star Trek: Voyager - Across the Unknown-ban
- Fejhallgató erősítő és DAC topik
- Samsung Galaxy S23 Ultra - non plus ultra
- Parfüm topik
- Beleremegett Hollywood Brad Pitt és Tom Cruise AI harcába
- Energiaital topic
- További aktív témák...
- T14 Gen2i 14" FHD IPS érintő i5-1135G7 16GB 256GB NVMe ujjlolv IR kam gar
- Lenovo ThinkPad P14s Gen 4 Intel Core i7-1370P Nvidia T550 32GB 512GB 1 év teljeskörű garancia
- Eladó Fujifilm Fujinon XF 27mm f/2.8 R WR objektív
- DELL Precision 5540 Workstation i7-9850H Nvidia Quadro T2000 32GB 512GB 15.6" 1év garancia
- BOMBA ÁRrR! Lenovo ThinkPad T14s Gen 4 Ryzen 5 PRO 7540U 14" FHD+ 32GB 1TB Lenovo gar: 2028.01.07!
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest


