Challenge: jruby to edit the DOM

Hi all.

Here’s my challenge to anybody out there:
Make a way so that, using jruby, you can edit the DOM of a page.

Here’s an excellent start:
http://almaer.com/blog/running-ruby-in-the-browser-via-script-typetextruby/comment-page-1#comment-47381

Any takers?
-r

In SWT it would be totally possible.

Browser widget ↔ JavaScript ↔ Java ↔ JRuby

We actually have this implemented in redcar so you can call jruby to
execute js in the browser. So if nothing else you can do:

browser.execute “$(‘#posts’).append(‘

hi

’)”

But if you cared, you could wrap up the jQuery API in a JRuby API.

Done!

On 7 Oct 2010, at 23:08, Roger P. wrote:


Posted via http://www.ruby-forum.com/.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Of course the ideal would be to be able to
communicate from the browser straight into the applet…

Appears that it is possible to access the DOM from an applet:

as well as run javascript generated from within an applet, within that
page:

So appears the building blocks are there…
Created a bounty for it:

Ruby Bounties · rdp/ruby_bounties Wiki · GitHub (at the bottom)
-r

Daniel L. wrote:

In SWT it would be totally possible.

Browser widget <-> JavaScript <-> Java <-> JRuby

True. Interesting. Ideally I’d want to be able to do it in the browser
itself…I suppose one option would be to actually use jruby (in an
applet) to run a local web server that you can send and receive AJAX
calls from. That would be intense, but maybe work (and probably be
cross browser compatible). Of course the ideal would be to be able to
communicate from the browser straight into the applet…

-r