问题描述
我正在寻找使用eval()的object参数的示例。
- -
CWHoleman II | -5
上帝只给了人类的一小部分,给予了特权
赚取一个人的面包做一个人乐意追求的自由,为
激情。我很感激。 The Mythical Man-Month Epilogue / F.P.Brooks
I am looking for an example using the object argument to eval().
http://developer.mozilla.org/en/docs...Functions:eval
--
C.W.Holeman II | cw***@Julian5Locals.com-5 http://JulianLocals.com/cwhii
To only a fraction of the human race does God give the privilege of
earning one''s bread doing what one would have gladly pursued free, for
passion. I am very thankful. The Mythical Man-Month Epilogue/F.P.Brooks
推荐答案
eval(" alert(x);",{x:42});
eval("alert(x);", {x:42});
为什么?一个更好的问题是需要评估的场景是什么?b $ b因为替代品是不可用的(或合理的替代品)。
-
兰迪
机会有利于准备好的心灵
comp.lang.javascript常见问题 -
Javascript最佳实践 -
< URL:http://www.merlyn.demon.co.uk/holidays.htmapplies eval to
DataBox.value - 这不仅仅是一个对象,而是它的一个主要部分
是一个对象赋值,我看不出任何东西来防止代码被调整为
以便DataBox.value包含一个Object Literal,{...}。
或者你想要一个简单的例子吗?
-
(c)John Stockton,英国萨里。 [email protected] Turnpike v6.05 IE 6.
Web< URL:http://www.merlyn.demon.co.uk/- w。常见问题主题,链接,首字母缩略词
PAS EXE等:< URL:http://www.merlyn.demon.co.uk/programs/-见00index.htm
日期 - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm等
<URL:http://www.merlyn.demon.co.uk/holidays.htmapplies eval to
DataBox.value - that''s more than just an Object, but a major part of it
is an Object assignment, and I see nothing to prevent the code being
adjusted so that DataBox.value contained a single Object Literal, {...}.
Or did you want a simple example?
--
(c) John Stockton, Surrey, UK. [email protected] Turnpike v6.05 IE 6.
Web <URL:http://www.merlyn.demon.co.uk/- w. FAQish topics, links, acronyms
PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/- see 00index.htm
Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.
这篇关于eval(string [,object])示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!