码迷,mamicode.com
首页 > 编程语言 > 详细

JavaScript eval() 函数

时间:2018-01-17 16:05:05      阅读:150      评论:0      收藏:0      [点我收藏+]

标签:效果   font   100%   http   ima   style   微软   bottom   hello   

<html>
<body>

<script type="text/javascript">

eval("x=10;y=20;document.write(x*y)")
document.write("<br />")

document.write(eval("2+2"))
document.write("<br />")

var x=10
document.write(eval(x+17))
document.write("<br />")

eval("alert(‘Hello world‘)")

</script>

</body>
</html>

 

 
 
效果:
技术分享图片
 

 

JavaScript eval() 函数

标签:效果   font   100%   http   ima   style   微软   bottom   hello   

原文地址:https://www.cnblogs.com/ChenChunChang/p/8302578.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!