最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - JSLint "document.write can be a form of eval" - How is this so? - Stack Overflow

programmeradmin4浏览0评论

I've e across this message in JSLint...

document.write can be a form of eval.

and was wondering exactly how so?

The JSLint instructions page states:

The eval function...provide access to the JavaScript piler. This is sometimes necessary, but in most cases it indicates the presence of extremely bad coding....

So, how does document.write "provide access to the JavaScript piler" then?

Thanks

I've e across this message in JSLint...

document.write can be a form of eval.

and was wondering exactly how so?

The JSLint instructions page states:

The eval function...provide access to the JavaScript piler. This is sometimes necessary, but in most cases it indicates the presence of extremely bad coding....

So, how does document.write "provide access to the JavaScript piler" then?

Thanks

Share Improve this question asked Mar 30, 2011 at 15:59 Mutation PersonMutation Person 30.5k18 gold badges100 silver badges165 bronze badges 1
  • See this answer: stackoverflow./a/15048239/798677 – That Brazilian Guy Commented May 16, 2017 at 21:33
Add a ment  | 

1 Answer 1

Reset to default 14

What does your browser do with this?

document.write('<script type="text/javascript">window.alert("evaled " + (1 + 2))</script>');
发布评论

评论列表(0)

  1. 暂无评论