logoalt Hacker News

nswangoyesterday at 5:36 PM3 repliesview on HN

For a long time the standard way of loading JSON was using eval.


Replies

bawolffyesterday at 7:52 PM

Not that long, browsers implemented JSON.parse() back in 2009. JSON was only invented back in 2001 and took a while to become popular. It was a very short window more than a decade ago when eval made sense here.

Eval for json also lead to other security issues like XSSI.

show 1 reply
_fluxyesterday at 6:04 PM

And why do we not anymore make use of it, but instead implemented separate JSON loading functionality in JavaScript? Can you think of any reasons beyond performance?

show 2 replies