Why not eval() JSON?

前端 未结 6 791
再見小時候
再見小時候 2020-12-10 06:14

As far as I know it is considered bad practice to eval() JSON objects in JavaScript, because of security. I can understand this concern if the JSON comes from a

6条回答
  •  粉色の甜心
    2020-12-10 06:33

    Tip: in asp.net using JSON is considered bad becuase parsing of DateTime differs between the server and the client so we use a special function to deserialize the date in javascript. I'm not sure if PHP has the same issue but its worth mentioning though.

提交回复
热议问题