tags:

views:

73

answers:

2

is there a php library or something?

A: 

You can execute JavaScript on the server side using Java 6 and Rhino.

duffymo
+2  A: 

There's quite a few ways of executing JavaScript on the server-side. A recently popular environment is node.js. There's also options such as Rhino (which has Nitro and Helma). Wikipedia also has a massive list of server-side JavaScript environments.

You also asked if there was a PHP extension available. There's one called php-js, based upon Mozilla's SpiderMonkey.

Brian McKenna
here's tutorial for rhino: http://sites.google.com/site/javascript4rhino/
also, this might help too: http://www.terminally-incoherent.com/blog/2008/01/08/rhino-scripting-java-with-javascript/