Results 1 to 2 of 2

Thread: javascript in terminal

  1. #1
    Join Date
    Feb 2012
    Beans
    100

    javascript in terminal

    Im learning some javascript at codeacademy.com and I wanted to write some of my own stuff and then run it in the terminal.

    After searching, I decided I needed rhino in order to run javascript, but it doesn't seem to understand the same javascript I am learning.

    for example:

    Code:
    jeff@ubuntu:~$ rhino
    Rhino 1.7 release 3 2012 02 16
    js> console.log("Hello World");
    js: uncaught JavaScript runtime exception: ReferenceError: "console" is not defined.
    
    js>
    How can I get this to work like I am learning it, is it trying to read a different version of javascript or something?
    RadBrains.com - unrelated trading blog

  2. #2
    Join Date
    May 2007
    Beans
    314
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: javascript in terminal

    Quote Originally Posted by LLCoolJeff View Post
    Im learning some javascript at codeacademy.com and I wanted to write some of my own stuff and then run it in the terminal.

    After searching, I decided I needed rhino in order to run javascript, but it doesn't seem to understand the same javascript I am learning.

    for example:

    Code:
    jeff@ubuntu:~$ rhino
    Rhino 1.7 release 3 2012 02 16
    js> console.log("Hello World");
    js: uncaught JavaScript runtime exception: ReferenceError: "console" is not defined.
    
    js>
    How can I get this to work like I am learning it, is it trying to read a different version of javascript or something?
    JavaScript is rather a browser language, so the best way (and the most reasonable) to test your code is to do it in browser.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •