Interactive JavaScript interpreter anywhere?

B

bill

Is there a nice interactive JavaScript interpreter, analogous to
Python's or Perl's (perldb)? I'm looking for something for Linux,
and that supports readline. I want to be able to try out small
snippets of JavaScript code without having to rely on a browser.

Many thanks!

-bill
 
M

Myron Turner

Is there a nice interactive JavaScript interpreter, analogous to
Python's or Perl's (perldb)? I'm looking for something for Linux,
and that supports readline. I want to be able to try out small
snippets of JavaScript code without having to rely on a browser.

Many thanks!

-bill



I'm not familiar with a readline function in Javascript. But there is
a limited functinality for testing code in the Netscape/Mozilla
Javascript Console. It's under Tools->Web development

Myron Turner

Myron Turner
www.room535.org
 
M

Martin Honnen

bill said:
Is there a nice interactive JavaScript interpreter, analogous to
Python's or Perl's (perldb)? I'm looking for something for Linux,
and that supports readline. I want to be able to try out small
snippets of JavaScript code without having to rely on a browser.

If you download a Mozilla zip build from http://www.mozilla.org/ you get
the XPCOM shell (xpcshell) I think (I have it here under Windows, hope
they build on LINUX too), it is interactive and allows you to run
scripts using Spidermonkey, the JavaScript engine of Mozilla. Example:

js> var a = ["Kibology", "for", "all"];
js> a.join(" ")
Kibology for all
js>

I don't think however it has any readline.

You can also get the source of Spidermonkey from http://www.mozilla.org/
and build it, it also has a shell I think.

But of course you need to be aware that most scripting you do in a HTML
page in a browser depends on host objects like window, document,
HTMLElement etc. that are not implemented in the script engine and are
therefore not available in the shell.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top