Revision 134208 of eval

  • Revision slug: Talk:JavaScript/Reference/Global_Objects/eval
  • Revision title: eval
  • Revision id: 134208
  • Created:
  • Creator: Nickolay
  • Is current revision? No
  • Comment please go ahead

Revision Content

There are some bad examples here.

First, all statements should have semicolons. Although optional, it should definitely be encouraged.

Second, the last example has this: eval ("document.forms{{mediawiki.external(0)}}." + textObject + ".value") = newValue. That is a really bad use of eval. eval shouldn't be used at all there! It should be document.forms{{mediawiki.external(0)}}{{mediawiki.external('textObject')}}.value

--Maian 23:19, 24 Aug 2005 (PDT)

This is a wiki, so go ahead and fix this. If someone thinks your changes are inappropriate (I'm not talking about the changes you suggested here), they can revert the page and explain why they did so on the talk page. --Nickolay 02:13, 25 Aug 2005 (PDT)

Revision Source

<p>There are some bad examples here.
</p><p>First, all statements should have semicolons.  Although optional, it should definitely be encouraged.
</p><p>Second, the last example has this: <code>eval ("document.forms{{mediawiki.external(0)}}." + textObject + ".value") = newValue</code>.  That is a <i>really</i> bad use of eval.  eval shouldn't be used at all there!  It should be <code>document.forms{{mediawiki.external(0)}}{{mediawiki.external('textObject')}}.value</code>
</p><p>--<a href="User:Maian">Maian</a> 23:19, 24 Aug 2005 (PDT)
</p>
<dl><dd> This is a wiki, so go ahead and fix this. If someone thinks your changes are inappropriate (I'm not talking about the changes you suggested here), they can revert the page and explain why they did so on the talk page. --<a href="User:Nickolay">Nickolay</a> 02:13, 25 Aug 2005 (PDT)
</dd></dl>
Revert to this revision