Category: surebert
01/30/07 12:39 - 19ºF - ID#37915
Surebert 2.50
There are tons of new features most of which are covered in the auto docs and many of which are covered in the demos on the front page of the site.
I will integrate it with estrip sometime in the near future. It should make any difference to the end users but will make making new stuff even easier.
Permalink: Surebert_2_50.html
Words: 135
Location: Buffalo, NY
Category: javascript
01/28/07 03:08 - 29ºF - ID#37895
Working WIth Rhino Javascript Engine
I know the outside links don't work right this minute. I fix it tomorrow. In the mean time I am having fun with Rhino , a command line java based javascript interpreter than lets you run javascript as a shell scripting language which harnesses the power of java.
It is over at the mozilla foundation site. It is great being able to read and write files, process data and run system commands with jjavascript. If you are interested in that sort of thing you should download it and play around with it. It works on linux, mac os x, and windows.
After downloading the last version of rhino zip and extracting the contents, you can run any javascript file at the command prompt by typing this in the rhino directory you download. You can move the js.jar somewhere else and put it in your path if you want to be able to use it from else where
java -jar /path/to/js.jar myFile.js myArgument1 myArgument2
The first part of the statement tells the computer you are running a java program in jar format the next argument is the name of the jar file which is js.jar, the executable that comes with rhino and interprets javascript. The next argument is the name of the javascript file you want to run. IN this case myScript.js and the last set of data are any arguments you want to pass to the script. Arguments are read from the script just like they are in any javascript function, by referencing the arguments array.
So lets make a simple file.
sayMyName.js
[box]
if(arguments[0]){
print('Hello '+arguments[0]);
} else {
print('Give me your name as the first argument of the script');
}
[/box]
Then run java -jar js.jar sayMyName.js Paul
This would print Hello Paul. If you left off the Paul argument it would say Give me your name as the first argument of the script'. The print command prints to the terminal window.
Here is some great ifo about setting the javascript interpreter up in you bash shell so that you can simply type js myJsFIle.ks to run the javascript from anywhere. There is also information about running system commands.
Permalink: Working_WIth_Rhino_Javascript_Engine.html
Words: 428
Location: Buffalo, NY
Author Info
Date Cloud
Category Cloud
- User must have at least 3 blogs in one category for categories list to show.
My Fav Posts
- This user has zero favorite blogs selected ;(