JavaScript evaluator

This tool provides a form and JavaScript that can be inserted into a web page to provide assistance with debugging problems with JavaScript. The form consists of an input field, three buttons (Evaluate, Show, and Properties) and an output field.

JavaScript expressions can be entered into Expr field; the expression is evaluated when the ENTER key is pressed or the Evaluate button is clicked.

Clicking Show button will copy the output into a new browser window.

If the expression was an object (for example, the output shows “[object]”), the Properties button will show the properties in a new browser window. You can also show the properties using the showProps function; for example by evaluating showProps('document').


This example was inspired by:
  evaluatorJR.html
  From JavaScript Bible 4th Edition by Danny Goodman
  http://www.dannyg.com
  Copyright 2001 Danny Goodman. All Rights Reserved.


Download

evaluator.html

Try it

Here is the evaluator opened in an IFRAME. Note that the content of this IFRAME is in a different domain so you will not have access to the main content window.


Send me reports of any errors or suggestions you have about my examples.


The code described on this page is Copyright 2002, 2003 Tony Lewis <tlewis@exelana.com>.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.