Hirdetés
- sziku69: Fűzzük össze a szavakat :)
- Luck Dragon: Asszociációs játék. :)
- Brogyi: CTEK akkumulátor töltő és másolatai
- D1Rect: Nagy "hülyétkapokazapróktól" topik
- gban: Ingyen kellene, de tegnapra
- btz: Internet fejlesztés országosan!
- Magga: PLEX: multimédia az egész lakásban
- Viber: ingyen telefonálás a mobilodon
- sziku69: Szólánc.
- eBay-es kütyük kis pénzért
-
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
- Iqos cigaretta
- Revolut
- Felrobbant a Pixel Fold Zack Nelson kezében
- Ford topik
- Windows 11
- E-roller topik
- Kuponkunyeráló
- Steam, GOG, Epic Store, Humble Store, Xbox PC Game Pass, Origin Access, uPlay+, Apple Arcade felhasználók barátságos izgulós topikja
- YouTube
- Lenovo Legion Go: a legsokoldalúbb kézikonzol
- További aktív témák...
- HP 14 Elitebook 640 G9 FHD IPS i5-1235U 4.4Ghz 10mag 16GB 256GB Intel Iris XE Win11 Pro Garancia
- Új Lenovo E14 Thinkpad WUXGA IPS Ryzen7 7730U 16GB 512GB SSD Radeon RX Vega8 Win11 Pro Garancia
- HP Z240 Komplett asztali pc, garanciával, 1050ti 4GB Videóval!
- i3 8100 és i5-9400 processzorok
- 6 és 7. generációs i3 és i5 procik
- ÁRGARANCIA!Épített KomPhone Ryzen 7 7700X 32/64GB RAM RTX 5070 Ti 16GB GAMER PC termékbeszámítással
- LG 27GS95QE - 27" OLED / QHD 2K / 240Hz & 0.03ms / 1000 Nits / NVIDIA G-Sync / AMD FreeSync
- Apple iPad A16 128GB,Újszerű,Dobozával,12 hónap garanciával
- GYÖNYÖRŰ iPhone 13 mini 128GB Starlight -1 ÉV GARANCIA -Kártyafüggetlen, MS3618,96% Akksi
- BESZÁMÍTÁS! Gigabyte H610M i5 13400F 32GB DDR4 512GB SSD RTX 3060Ti 8GB ZALMAN S2 TG Seasonic 650W
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Cég: Promenade Publishing House Kft.
Város: Budapest