Security risks of using eval() to execute user input in JavaScript

前端 未结 7 1420
伪装坚强ぢ
伪装坚强ぢ 2020-12-07 02:31

I\'m planning on throwing together a quick web page for my students to teach them about JavaScript programming. On this page, I\'d like to give them a text box and allow the

7条回答
  •  太阳男子
    2020-12-07 02:45

    There is really no serious risk here. For example, open up firebug on this page and type in the console: eval("alert('hello');");, problem? Not really.

    For demo purposes this is no big deal.

提交回复
热议问题