views:

518

answers:

16

I would like to know about JavaScipt. Is Javascript available only for web browsers? Because I used some JavaScript code for Firefox Plugin development and Thunderbird.

Help me to find out more about this: where can I use JavaScript other than web browsers, and how?

+11  A: 

No! Have a look at Google's V8

Clark Gaebel
+10  A: 

Google Javascript. Click first link (Wikipedia). Click "uses outside webpages".

http://en.wikipedia.org/wiki/JavaScript#Uses_outside_web_pages

z5h
+3  A: 

No, there are definitely other implementations. For instance, JScript.Net is included with the .NET framework.

norheim.se
I've definitely heard of people using JScript.NET.
eyelidlessness
Ok. Then I should probably stop trying to make fun of it. I've updated my answer.
norheim.se
+12  A: 

There's node.js which includes a full webserver and runs on Google's V8

Kaleb Pederson
+4  A: 

There are a number of server-side (or otherwise non-browser) implementations of Javascript, including Node.js, which currently has a lot of momentum behind it, as well as the now-defunct Jaxer, which provided a server-side DOM implementation based on Mozilla Gecko. There are also efforts to bring DOM type functionality to Node.js, primarily from Yahoo.

eyelidlessness
Is Jaxer really defunct?
Daniel Vassallo
@Daniel Vassallo, Sadly, yes. They haven't produced a release for over a year, and no longer discuss development of the product. I'm pretty sure they've abandoned the product completely.
eyelidlessness
@Daniel, on the other hand it appears there's some regular activity on their GitHub repository, so someone may have taken up the slack. But Aptana is definitely not pushing it as they once were.
eyelidlessness
+1  A: 

Many text editors (including the one I use, ActiveState's Komodo Edit) expose their APIs and let you write macros in Javascript.

Robusto
+1  A: 

There are several implementations of stand-alone Javascript JSLibs (http://code.google.com/p/jslibs/) is general purpose jsdb (http://www.jsdb.org/) is more database oriented

Pablo Grisafi
+1  A: 

Using Adobe AIR you can write almost platform-independent Desktop Applications using JavaScript

Michael
+3  A: 

With Rhino, you can embed Javascript in Java applications.

Nils Weinander
... and the more convenient http://ringojs.org on top of Rhino.
oberhamsi
+1  A: 

PDF files can also contain JavaScript code. See first entry in google on this subject and also Adobe JavaScript virus.

lmsasu
+1  A: 

PDF files can also contain JavaScript code. See first entry in google on this subject and also Adobe JavaScript virus.

lmsasu
+3  A: 

MS-Windows can execute .js files (from the command prompt).

Since you do not have the browser context, you cannot use any calls to the browser (alert, for example, does not work).

Look for "Windows Scripting Host".

WSH supports scripts written in Microsoft Visual Basic Scripting Edition (VBScript) or JavaScript.

GvS
+1  A: 

Javascript can be easily embedded in applications written in other programming languages.

For Java there is as already mentioned Rhino, for C++ you can use for example Flusspferd. Here are some tutorials/examples.

David Klein
A: 

Qt has the QtScript module. From Qt 4.7 it uses JavaScriptCore (the Webkit JavaScript engine).

scomar
A: 

In short, No.

Actually, Javascript and other Web technologies are used these days to create native mobile and desktop applications. (see Titanium Appcelerator and PhoneGap)

If you are familiar with the KDE project you can craft Plasma widgets using JavaScript, see Creating plasmoids with JavaScript

In Qt framework there is a QtScript module for JavaScript (ECMAScript) application scripting to provide much of the application’s functionality.

Also the new technology that is soon to be released in Qt 4.7 is Qt Quick, aka the Qt UI Creation Kit, which allows application developers to declaratively define their user interfaces in QML, for more information go here and an example here

QML is an extension to JavaScript, that provides a mechanism to declaratively build an object tree of QML elements. QML improves the integration between JavaScript and Qt's existing QObject based type system, adds support for automatic property bindings and provides network transparency at the language level.

And let's not forget Javascript is used as an embedded scripting language in various applications OpenOffice.org, Google Desktop Widgets, and many others, see Wikipedia's article here

On the server-side Javascript enables back-end access to databases, file systems, etc (see Node.js, Google V8, SpiderMonkey and others here)

Alex Butum
A: 

Some document databases, such as CouchDB and MongoDB, use JavaScript to interact with the database.

Niels van der Rest