- Prohardver app (nem hivatalos)
- iPhone topik
- Apple Watch
- Vivo X200 FE – fenséges méret
- Apple Watch Ultra - első nekifutás
- Motorola Edge 50 Neo - az egyensúly gyengesége
- Samsung Galaxy S25 Ultra - titán keret, acélos teljesítmény
- Netfone
- Yettel topik
- Youtube Android alkalmazás alternatívák reklámszűréssel / videók letöltése
-
Mobilarena
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
- Prohardver app (nem hivatalos)
- BestBuy topik
- Folyószámla, bankszámla, bankváltás, külföldi kártyahasználat
- iPhone topik
- NBA és kosárlabda topic
- Intel Core i5 / i7 / i9 "Alder Lake-Raptor Lake/Refresh" (LGA1700)
- Apple Watch
- Milyen egeret válasszak?
- Vivo X200 FE – fenséges méret
- Apple Watch Ultra - első nekifutás
- További aktív témák...
- Microsoft Surface Pro 7 Érintős Szétszedhető Laptop Tablet 12,3" -80% i5-1035G4 8/256 Retina
- Mars Gaming MK60W 60% Mechanikus Blue Switches Gamer Billentyűzet Spanyol Kiosztás
- 2019 - BMW I3S 120Ah
- ASUS ROG Strix G15 144Hz / AMD Ryzen 5 / RTX 3050Ti / 16GB RAM / 512GB SSD
- Microsoft Surface Pro 7+ Érintős Szétszedhető Laptop Tablet 12,3" -80% i5-1135G7 16/256 Retina
- Samsung Galaxy A32 128GB, Kártyafüggetlen, 1 Év Garanciával
- Logitech G513 Carbon Tactile DE (3) (ELKELT)
- Telefon felvásárlás!! Honor Magic6 Lite, Honor Magic6 Pro, Honor Magic7 Lite, Honor Magic7 Pro
- Lenovo Thinkpad 13 Core i3-7100 / 8GB DDR4 / 256GB SSD
- Honor 200 Lite 256GB, Kártyafüggetlen, 1 Év Garanciával
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Cég: CAMERA-PRO Hungary Kft.
Város: Budapest