Publisher review:eval() in javascript - Run string of javascript through eval() function. Run string of javascript through eval() function.
Copy and paste. Run in browser. Looking for a quick way to access elements rather than sorting through arrays of elements by tag name, id, etc? Want to call variable functions? Eval takes a string of javascript and runs it. The code below gives a quick example where you run arbitrary javascript through the form. This has many more uses though. Say you have 30 span tags each named "myspantable1_" #, and the numbers range from 0 to 29. If you want to call a function on each of them, you do not have to send the full name or search for the array of span tags and figure out what one you want. Just send the number to a function and use eval("myspan" number ...) to perform your desired task. There is always a way to do it without eval(), but i can think of a few places where its more efficient or clearer to use eval.
eval() in javascript is a JavaScript script for Snippets scripts design by okyup.
It runs on following operating system: Windows / Linux / BSD / Solaris.
Operating system:Windows / Linux / BSD / Solaris