Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • That is exactly my problem. Is there any problem with using eval this way? I have seen all over that it is "bad." Commented Mar 6, 2011 at 1:45
  • Using eval is a code smell in javascript because it usually means you don't know the "right" way to do something and it also can be unsafe in some situations to eval a string. In this case, however, it's ok. You can also take a look at jslint (jslint.com/lint.html) if you want to see how your code holds up against some javascript best practices. Commented Mar 8, 2011 at 3:45