eval() in javascript JavaScript script

SPONSORED LINKS

    Specification

  • Version:
  • File size: 0 KB
  • File name: snippet681.htm
  • Last update:
  • Platform: Windows / Linux / BSD / Solaris
  • Language: JavaScript
  • Price:Freeware
  • Company: okyup (View more)

eval() in javascript script description:




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

Latest script and internet news

222

222

22

Posted on: 18 Jul 2023 22:27 by A. Brown

111

111

111

Posted on: 18 Jul 2023 22:24 by A. Brown

The permanently active Push system offered by the new Google Chrome 42

The permanently active Push system offered by the new Google Chrome 42

Hacked By !Sc-sT

Posted on: 17 Mar 2015 07:57 by A. Brown

SPREAD THE WORD

User Rating


Rating: 2.2 out of 5
Based on 13 ratings. 13 user reviews.

  • Currently 2.15 out of 5
  • 1
  • 2
  • 3
  • 4
  • 5