473,586 Members | 2,855 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can I run JavaScript without a browser?

RC
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.
Jul 25 '07 #1
11 15260
On Jul 25, 2:56 pm, RC <raymond.c...@n ospam.noaa.govw rote:
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.

Jul 26 '07 #2
RC wrote:
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
Jul 26 '07 #3
jcb
On Wed, 25 Jul 2007 08:56:04 -0400, RC wrote:
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.

Jul 26 '07 #4
jcb
>
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.
Jul 26 '07 #5
In comp.lang.javas cript message <f8**********@n ews.nems.noaa.g ov>, Wed,
25 Jul 2007 08:56:04, RC <ra**********@n ospam.noaa.govp osted:
>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.c om/faq/index.html>.
<URL:http://www.merlyn.demo n.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 26 '07 #6
Dr J R Stockton said the following on 7/26/2007 8:32 AM:

<snip>
<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.javas cript 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.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jul 26 '07 #7
In comp.lang.javas cript message <eI************ ********@telcov e.net>,
Thu, 26 Jul 2007 15:13:40, Randy Webb <Hi************ @aol.composted:
>Dr J R Stockton said the following on 7/26/2007 8:32 AM:

<snip>
><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.java script 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.

>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.
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.c om/faq/index.html>.
<URL:http://www.merlyn.demo n.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 27 '07 #8
Dr J R Stockton said the following on 7/27/2007 7:48 AM:
In comp.lang.javas cript message <eI************ ********@telcov e.net>,
Thu, 26 Jul 2007 15:13:40, Randy Webb <Hi************ @aol.composted:
>Dr J R Stockton said the following on 7/26/2007 8:32 AM:

<snip>
>><FAQENTRYTh e 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.java script 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.
>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.
>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.
When are you going to deliver a new version of the FAQ?
When I have time to finish it.
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.c om/group/comp.lang.javas cript/browse_frm/thread/f2bddaa32b22bd1 6/c3979cc5b3489d5 b?lnk=gst&q=+Ra ndy+Webb+stfu&r num=1#c3979cc5b 3489d5b>
--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jul 30 '07 #9
On Jul 25, 5:56 am, RC <raymond.c...@n ospam.noaa.govw rote:
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

Jul 30 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3047
by: Mike Biang | last post by:
Is there a way to request a server script through javascript without having the browser navigate to another page? Similar to the effects of calling the server.execute method in ASP. Is anyone familiar with a method to accomplish this?
5
3057
by: wylbur37 | last post by:
How do you find out what version of JavaScript your browser supports? Is there a JavaScript function that will tell you? __________________________________ Do you Yahoo!? Find out what made the Top Yahoo! Searches of 2003 http://search.yahoo.com/top2003
1
2196
by: zeeshan359 | last post by:
Hi, I need free script that is "date and time" picker in javascript without popup, It should be in iframe or div or layers. I shall be thankful to you, if you provide me some details of it. Regards Zeeshan
1
2180
by: jatrojoomla | last post by:
Hi, I am New in JS world, I want's to submit a from using JavaScript ? is it possible? if yes then how? how to impliment document.form.submit? plz help me.
3
5585
by: vinay | last post by:
Hi All I have a page in which i using user control .on user control i using javascript to pop up a message .when i choose wrong date in user control & submits the page it alerts the message of javascript but page refrehes. I want to use javascript without page refresh or without postback . Is this possible to use javascript without page...
8
8929
by: wpelgrum | last post by:
When I open a webpage with javascript my browser (both IE6 and FF2.0.0.3) freezes anywhere from seconds to more than a minute. During that period, the browser is frozen and windows (XP-SP2) is very poorly responsive. There is no significant CPU-load. When I disable javascript in FireFox, everything works smoothly again. I have...
2
6968
by: pavi | last post by:
Anyone know how to set the Default homepage using javascript without prompting a pop up. Below is the code i used to set default home page. <a href="#" onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http:// www.xyz.com');">set the homepage</a> The problem with this code is when i click the link it prompts me a
0
7911
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
1
7954
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8215
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5710
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5390
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3836
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3864
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2345
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1179
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.