Quick References
ADO
ASP
CSS2
HTML
JavaScript
Jet SQL
VBScript
WML
WMLScript
WSH
XHTML
XML DOM
XSLT
Features
Knowledge Base
Tutorials
Partners
ZVON.ORG
XML
Planet Source Code
VisualBuilder
Web Design
Your HTML Source
XML/XSLT Forums
ASPAlliance
Scripts
Programmers Heaven
Tek-Tips Forums
Developer Fusion
Code Project
All Functions
Object Object
Function: eval
eval
(
codestring
)
The top-level function,
eval
, evaluates and/or executes a string of JavaScript code that is contained in the
codestring
argument.
First,
eval
determines if the argument is a valid string and then parses the string looking for JavaScript code. If there are JavaScript statements in the code, they will be executed and
eval
will return the value of the last statement (if there is a value). If there is a JavaScript expression, it will be evaluated and its value will be returned.
Note that the
codestring
argument is optional. However, if there is no argument,
eval
returned, "undefined".
Code:
eval("fred=999; wilma=777; document.write(fred + wilma);");
Output:
1776
Copyright 1999-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information