Connecting Tech Pros Worldwide Help | Site Map

Can I run JavaScript without a browser?

RC
Guest
 
Posts: n/a
#1: Jul 25 '07
I wrote many JavaScripts, they can only run
in a browser (Netscape, IE, Firefox, etc.)
I am wonder how can I run the JavaScript
in the command line (UNIX/LINUX, Windows)?
Similar we can run Perl, PHP, Python, Visual Base, .Net,
etc. in command line, Desktop.
Petronius
Guest
 
Posts: n/a
#2: Jul 26 '07

re: Can I run JavaScript without a browser?


On Jul 25, 2:56 pm, RC <raymond.c...@nospam.noaa.govwrote:
Quote:
I wrote many JavaScripts, they can only run
in a browser (Netscape, IE, Firefox, etc.)
I am wonder how can I run the JavaScript
in the command line (UNIX/LINUX, Windows)?
Similar we can run Perl, PHP, Python, Visual Base, .Net,
etc. in command line, Desktop.
Javascript can be embedded e.g. in Java, Rhino provides great tools as
for data exchange between Java and Javascript.

filippo pacini
Guest
 
Posts: n/a
#3: Jul 26 '07

re: Can I run JavaScript without a browser?


RC wrote:
Quote:
I wrote many JavaScripts, they can only run
in a browser (Netscape, IE, Firefox, etc.)
I am wonder how can I run the JavaScript
in the command line (UNIX/LINUX, Windows)?
Similar we can run Perl, PHP, Python, Visual Base, .Net,
etc. in command line, Desktop.
Hi,
take also a look at spidermonkey, The mozilla implementation of javascript.

http://www.mozilla.org/js/spidermonkey/

On ubuntu you can install it with:
apt-get install spidermonkey-bin

cheers,
--
Filippo Pacini
jcb
Guest
 
Posts: n/a
#4: Jul 26 '07

re: Can I run JavaScript without a browser?


On Wed, 25 Jul 2007 08:56:04 -0400, RC wrote:
Quote:
I wrote many JavaScripts, they can only run
in a browser (Netscape, IE, Firefox, etc.)
I am wonder how can I run the JavaScript
in the command line (UNIX/LINUX, Windows)?
Similar we can run Perl, PHP, Python, Visual Base, .Net,
etc. in command line, Desktop.
If your running you can install spidermonkey librariy (libjs) with

sudo yum install js

js is the javascript interpreter

J.

jcb
Guest
 
Posts: n/a
#5: Jul 26 '07

re: Can I run JavaScript without a browser?


>
Quote:
If your running you can install spidermonkey librariy (libjs) with
>
sudo yum install js
>
js is the javascript interpreter
>
J.

Sorry - that should be if you are running the fedora linux distribution.

J.
Dr J R Stockton
Guest
 
Posts: n/a
#6: Jul 26 '07

re: Can I run JavaScript without a browser?


In comp.lang.javascript message <f87h97$g3f$1@news.nems.noaa.gov>, Wed,
25 Jul 2007 08:56:04, RC <raymond.chui@nospam.noaa.govposted:
Quote:
>I wrote many JavaScripts, they can only run
>in a browser (Netscape, IE, Firefox, etc.)
>I am wonder how can I run the JavaScript
>in the command line (UNIX/LINUX, Windows)?
>Similar we can run Perl, PHP, Python, Visual Base, .Net,
>etc. in command line, Desktop.

Select Windows XP Start, Help and Support, then search for "cscript" and
"wscript", or search for "javascript" and read "Windows Script Host
overview".

Note
(0) Details may depend on system
(1) MS use the term JScript

<FAQENTRYThe FAQ should say a little more about JScript & WSH; add to
2.7 that JScript can be run from Windows command-line or GUI without
using a browser, and then has API access to the local system.

It's a good idea to write the newsgroup c.l.j and its FAQ. See below.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6
news:comp.lang.javascript FAQ <URL:http://www.jibbering.com/faq/index.html>.
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Randy Webb
Guest
 
Posts: n/a
#7: Jul 26 '07

re: Can I run JavaScript without a browser?


Dr J R Stockton said the following on 7/26/2007 8:32 AM:

<snip>
Quote:
<FAQENTRYThe FAQ should say a little more about JScript & WSH; add to
2.7 that JScript can be run from Windows command-line or GUI without
using a browser, and then has API access to the local system.
comp.lang.javascript is dedicated to client side scripting on the web.
The aspect of covering Windows based scripting has been discussed before
and this isn't the group for it. When people ask about it they either
get answered or pointed to a group dedicated to WScript/Cscript and as
such it shouldn't have anything in the FAQ other than a "For Windows
based scripting newsgroup ...... is the place to ask".

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Dr J R Stockton
Guest
 
Posts: n/a
#8: Jul 27 '07

re: Can I run JavaScript without a browser?


In comp.lang.javascript message <eIidnWzZp9UNbzXbRVn_vw@telcove.net>,
Thu, 26 Jul 2007 15:13:40, Randy Webb <HikksNotAtHome@aol.composted:
Quote:
>Dr J R Stockton said the following on 7/26/2007 8:32 AM:
>
><snip>
>
Quote:
><FAQENTRYThe FAQ should say a little more about JScript & WSH; add to
>2.7 that JScript can be run from Windows command-line or GUI without
>using a browser, and then has API access to the local system.
>
>comp.lang.javascript is dedicated to client side scripting on the web.
No, it is not so dedicated. That is merely the default assumption, when
not otherwise specified. Read FAQ section 2.2 para 1.

Quote:
>The aspect of covering Windows based scripting has been discussed
>before and this isn't the group for it.
But I am not suggesting "covering" it; merely that the FAQ should very
briefly indicate the other things which can be done with ECMAScript.
Quote:
When people ask about it they either get answered or pointed to a
>group dedicated to WScript/Cscript and as such it shouldn't have
>anything in the FAQ other than a "For Windows based scripting newsgroup
>...... is the place to ask".
But the FAQ is an ideal place to do that redirection, and to present the
actual value of .......'.

When are you going to deliver a new version of the FAQ? You have
achieved nothing useful for over four months now.

It's a good idea to read the newsgroup c.l.j and write its FAQ. See below.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6
news:comp.lang.javascript FAQ <URL:http://www.jibbering.com/faq/index.html>.
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Randy Webb
Guest
 
Posts: n/a
#9: Jul 30 '07

re: Can I run JavaScript without a browser?


Dr J R Stockton said the following on 7/27/2007 7:48 AM:
Quote:
In comp.lang.javascript message <eIidnWzZp9UNbzXbRVn_vw@telcove.net>,
Thu, 26 Jul 2007 15:13:40, Randy Webb <HikksNotAtHome@aol.composted:
Quote:
>Dr J R Stockton said the following on 7/26/2007 8:32 AM:
>>
><snip>
>>
Quote:
>><FAQENTRYThe FAQ should say a little more about JScript & WSH; add to
>>2.7 that JScript can be run from Windows command-line or GUI without
>>using a browser, and then has API access to the local system.
>comp.lang.javascript is dedicated to client side scripting on the web.
>
No, it is not so dedicated. That is merely the default assumption, when
not otherwise specified. Read FAQ section 2.2 para 1.
Well humpty dumpty shit. You have a point. My apologies. In the future I
will refrain from that statement and merely say that "99.99% of the
posts made to c.l.j are web browser related" and as such the aspect of
JScript via WSH isn't very "Frequently" asked here.
Quote:
Quote:
>The aspect of covering Windows based scripting has been discussed
>before and this isn't the group for it.
>
But I am not suggesting "covering" it; merely that the FAQ should very
briefly indicate the other things which can be done with ECMAScript.
And that discussion has been had, in depth, in the past.
Quote:
Quote:
>When people ask about it they either get answered or pointed to a
>group dedicated to WScript/Cscript and as such it shouldn't have
>anything in the FAQ other than a "For Windows based scripting newsgroup
>...... is the place to ask".
>
But the FAQ is an ideal place to do that redirection, and to present the
actual value of .......'.
And it is already covered. Specifically in the section you pointed me to
read.
Quote:
When are you going to deliver a new version of the FAQ?
When I have time to finish it.
Quote:
You have achieved nothing useful for over four months now.
I haven't? WOW. Either you are an all seeing deity or a blithering idiot
for thinking you know what I have achieved in the last four months.

<URL:
http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/f2bddaa32b22bd16/c3979cc5b3489d5b?lnk=gst&q=+Randy+Webb+stfu&rnum=1 #c3979cc5b3489d5b>


--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Peter Michaux
Guest
 
Posts: n/a
#10: Jul 30 '07

re: Can I run JavaScript without a browser?


On Jul 25, 5:56 am, RC <raymond.c...@nospam.noaa.govwrote:
Quote:
I wrote many JavaScripts, they can only run
in a browser (Netscape, IE, Firefox, etc.)
I am wonder how can I run the JavaScript
in the command line (UNIX/LINUX, Windows)?
Similar we can run Perl, PHP, Python, Visual Base, .Net,
etc. in command line, Desktop.
If you are trying to test browser scripts on the server you might be
interested in what John Resig has done

http://ejohn.org/blog/bringing-the-b...to-the-server/

and why this is a bad idea. Almost all big chunks of code has bugs so
writing a buggy simulation of buggy browsers wouldn't be very
productive to test browser bugs in relation to your scripts. I believe
the approach of Selenium is better for automated testing

http://www.openqa.org/

Although I'm not so keen on mini meta-languages like Selenese and the
software requires the Prototype library.

----------

If you are just interested in JavaScript on the server-side for
general-purpose scripting and other tasks for which folks use Perl/
Python/Ruby, then Spidermonkey and Rhino are the projects to check
out. I've been doing quite a bit of C programming lately to extend
Spidermonkey and it is infinitely flexible.

Peter

Thomas 'PointedEars' Lahn
Guest
 
Posts: n/a
#11: Aug 1 '07

re: Can I run JavaScript without a browser?


Randy Webb wrote:
Quote:
Dr J R Stockton said the following on 7/26/2007 8:32 AM:
Quote:
><FAQENTRYThe FAQ should say a little more about JScript & WSH; add to
>2.7 that JScript can be run from Windows command-line or GUI without
>using a browser, and then has API access to the local system.
>
comp.lang.javascript is dedicated to client side scripting on the web.
While most of the postings fall into that category, I don't think in
such absolute terms. For me, this is the place where to discuss the
language *and* its applications.


PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not the
best source of advice on designing systems that use javascript.
-- Richard Cornford, <f806at$ail$1$8300dec7@news.demon.co.uk>
RMZ
Guest
 
Posts: n/a
#12: Aug 1 '07

re: Can I run JavaScript without a browser?


On Jul 25, 7:56 am, RC <raymond.c...@nospam.noaa.govwrote:
Quote:
I wrote many JavaScripts, they can only run
in a browser (Netscape, IE, Firefox, etc.)
I am wonder how can I run the JavaScript
in the command line (UNIX/LINUX, Windows)?
Similar we can run Perl, PHP, Python, Visual Base, .Net,
etc. in command line, Desktop.
Yes you can. On the Windows platform see:
http://www.microsoft.com/technet/scr....mspx?mfr=true

Most examples are in VBScript, but the Windows Scripting Host also
supports ECMAScript/JavaScript.

Closed Thread