views:

65

answers:

3

Is it possible to use your own javascript engine in place of the browser's engine?

We have a cloud based JAVA app and uses a lot of javascript and ajax.

I don't know a ton about Java (just enough to get by), I'm an ajax programmer.

Mozilla has a javascript engine called rhino. Is that engine only for running javascript inside a native java app or can you use it in a java web app and use the rhino engine instead of the browser's engine?

Maybe I misunderstand the point of Rhino?

The reason I would like this is obviously because Internet Explorer is way too slow. I have been optimizing my scripts like crazy and IE is still unacceptable.

+1  A: 

Rhino is for server side JavaScript. There is nothing you can do about what a client uses, you have to work around it.

BioBuckyBall
Work-around? Is there a way to make the entire app in a way that the browser doesn't use the javascript and only the java app does? Like make this a server app that is accessed by the client, so that the javascript is run by rhino?
Dale
John Resig has post that I'm not sure of his intent. http://ejohn.org/blog/bringing-the-browser-to-the-server/ Not sure if he is just making the server more like a browser or that you can use the server's app in the browser.
Dale
You don't *need* to use javascript at all. If every action on the user's part causes a reload of the webpage, then all modifications to the page can be done at the server. This is not advantageous, and thus JavaScript is used.
Ryan Tenney
@Dale Work-around as in deal with it. Some users will use IE. Nothing you can do about that. So you work harder on your code so that it works for IE too. Post new questions with your scripts asking for IE optimization help (which will probably benefit the other browsers too).
BioBuckyBall
+1  A: 

You could interface with Node.js which runs its own instance of V8, Google's Javascript engine. All of the Javascript magic would be run on the server side. It's wicked fast too.

pferdefleisch
Do you have any examples of a web-app running Node.js?
Dale
the http://howtonode.org/ site runs on Nodejs and here is the github repo for the site http://github.com/creationix/howtonode.org!
pferdefleisch
+1  A: 

The only thing like this that comes to mind is Googles Chrome Frame. It's a plugin for IE that allows pages to request that the chrome engine is used to render the page instead of IE. This includes chromes fast javascript engine. It sounds like this would solve your problem as long as your end users are able to install browser plugins.

Adam
Thanks but we can't expect them to install a plugin. But it would be nice to give them the option.
Dale