亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

document.write can be a form of eval

那個警告是什么意思啊???

正在回答

12 回答

所以說都說盡量不要使用,倒是說一下該怎么安全使用啊。。。

0 回復 有任何疑惑可以回復我~

查了一下資料,只事JS編譯器對代碼編寫過于嚴格,但這種編碼方式是沒問題的。

0 回復 有任何疑惑可以回復我~

http://img1.sycdn.imooc.com//56e13c020001c32b19031929.jpg詞典。

0 回復 有任何疑惑可以回復我~

嗯,盡量不要使用eval

0 回復 有任何疑惑可以回復我~

不明所以~同求答案~

0 回復 有任何疑惑可以回復我~

“document.write can be a form of eval.”:“document.write是eval的一種形式”,?eval要盡量避免,是出于安全考慮,因為eval過于強大,他可以把string串作為代碼執行。如果控制不好就會造成安全漏洞。

10 回復 有任何疑惑可以回復我~

同問。

0 回復 有任何疑惑可以回復我~
eval("-_-")


0 回復 有任何疑惑可以回復我~

“document.write can be a form of eval.”:“document.write是eval的一種形式”,
‘eval is evil.’:“盡量不要使用eval”,

0 回復 有任何疑惑可以回復我~

JSLint flags any use of the?eval?statement with the message?eval is evil. This is because?eval?is a hook right into the JavaScript compiler. It accepts a string as a parameter and then compiles it and runs it.

Further resources on the evils of eval are available through the above link. Here we are more interested in how?document.write?can equate to?eval

So how can?document.write?possibly equate to being the same? Well, we can demonstrate this with a simple example. You’ll need to set up an HTML page and a JS File with the following code:


0 回復 有任何疑惑可以回復我~
首頁上一頁12下一頁尾頁

舉報

0/150
提交
取消
JavaScript入門篇
  • 參與學習       741276    人
  • 解答問題       9867    個

JavaScript做為一名Web工程師的必備技術,本教程讓您快速入門

進入課程
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號