Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Javascript On Linux?

ways Linux program

  • Please log in to reply
6 replies to this topic

#1 RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1311 posts
  • Location:C:\Countries\US
  • Programming Language:C, Java, C++, PHP, Python, JavaScript

Posted 06 April 2012 - 09:40 PM

There are multiple ways to use JavaScript on Windows - there's HTML for web pages, HTA for standalone applications, ASP for server-side scripting, JS (with Windows Script Host) for any JavaScript scripting.

What about on Linux? I know there's HTML, but are there other options?
  • 0
Regards,
RR

#2 Guest

Guest

    CC Devotee

  • Expert Member
  • PipPipPipPipPipPip
  • 914 posts
  • Programming Language:C

Posted 07 April 2012 - 12:55 AM

I know Mozilla provides backends for Firefox, the javascript backend being SpiderMonkey. There's also XULRunner and maybe other things like that could be interesting as well.
I did some poking around on the web, and there's also a Chrome (webkit?) version, called V8.
  • 0
Root Beer == System Administrator's Beer
Download the new operating system programming kit! (some assembly required)

#3 RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1311 posts
  • Location:C:\Countries\US
  • Programming Language:C, Java, C++, PHP, Python, JavaScript

Posted 07 April 2012 - 09:37 AM

But are there other ways besides .HTML ?
  • 0
Regards,
RR

#4 Guest

Guest

    CC Devotee

  • Expert Member
  • PipPipPipPipPipPip
  • 914 posts
  • Programming Language:C

Posted 07 April 2012 - 05:54 PM

I think you misunderstood. The Javascript engines run standalone, from the command line. They run .js files and don't need to render any HTML to run the javascript.
This page might give you a better idea of what you're doing: https://developer.mo...avaScript_shell
  • 0
Root Beer == System Administrator's Beer
Download the new operating system programming kit! (some assembly required)

#5 RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1311 posts
  • Location:C:\Countries\US
  • Programming Language:C, Java, C++, PHP, Python, JavaScript

Posted 07 April 2012 - 06:21 PM

But then it's not much different from other scripting languages - with regards to Linux - because in order for it to run the user must install some program. HTAs and JSs run on just about any Windows computer, from what I'm aware of; no need to install anything additional.

I guess Linux is just not as nice to JavaScript as Windows is; now I wonder if Macintosh is the same way as Linux.
  • 0
Regards,
RR

#6 Guest

Guest

    CC Devotee

  • Expert Member
  • PipPipPipPipPipPip
  • 914 posts
  • Programming Language:C

Posted 07 April 2012 - 06:36 PM

But then it's not much different from other scripting languages - with regards to Linux - because in order for it to run the user must install some program.

Well, it depends. Something that suprised me is Gnome Shell requires javascript bindings for Gnome, which require SpiderMonkey. So pretty much all GNU/Linux distributions should either include SpiderMonkey by default, or it should be easy to download via the package manager. Same usually goes for say, Python and Ruby. You may be surprised to find out that popular GNU/Linux programs use scripting languages, especially for things like graphical frontends.
  • 0
Root Beer == System Administrator's Beer
Download the new operating system programming kit! (some assembly required)

#7 Alexander

Alexander

    YOL9

  • Moderator
  • 3963 posts
  • Location:Vancouver, Eh! Cleverness: 200
  • Programming Language:C, C++, PHP, Assembly

Posted 07 April 2012 - 07:13 PM

HTAs and JSs run on just about any Windows computer, from what I'm aware of; no need to install anything additional.


Microsoft had no robust task automation via scripting. VBscript, jscript (as many knew JS) with the wscript object for the script host was born out of the necessity when already Apple products had Applescript and Unix products had Bourne Shell (sh).

More refined iterations are Microsoft's Power Shell (PS) and Unix's Bourne Again Sell (BASH).

I guess Linux is just not as nice to JavaScript as Windows is; now I wonder if Macintosh is the same way as Linux.

JavaScript was designed by Netscape and was *not* intended (in name) to be used for task automation, that is why you will not see it used as much as the other available shells on other systems.

You should research the origins and intended uses of each language you use as part of your learning experience.
  • 1

All new problems require investigation, and so if errors are problems, try to learn as much as you can and report back.






Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download