Interactive JavaScript interpreter anywhere?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bill

    Interactive JavaScript interpreter anywhere?




    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

  • Myron Turner

    #2
    Re: Interactive JavaScript interpreter anywhere?

    On Sat, 3 Jul 2004 20:50:45 +0000 (UTC), bill <please_post@no mail.edu>
    wrote:
    [color=blue]
    >
    >
    >
    >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
    >[/color]



    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

    Comment

    • Martin Honnen

      #3
      Re: Interactive JavaScript interpreter anywhere?



      bill wrote:
      [color=blue]
      > 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.[/color]

      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.

      --

      Martin Honnen


      Comment

      Working...