These are chat archives for opal/opal

1st
Oct 2014
Elia Schito
@elia
Oct 01 2014 08:17
:star:
George
@georgeu2000
Oct 01 2014 15:09
Regarding the purpose of Opal, do you have any notes about that? The more I work with it, the more I see that Ruby and JS are different. So it feels weird to write Ruby just to avoid writing JS.
I wonder if there are other goals, such as making the server and browser one system, instead of 2 separate systems?
Elia Schito
@elia
Oct 01 2014 16:45
@georgeu2000 for me it’s about having all the features that make Ruby great instead of all the “bad parts” of javascript. But I see that the more you interact with other JS libs the more you’ll experience the gap between the two languages…
George
@georgeu2000
Oct 01 2014 17:20
Do you have any specific use cases? For example, sharing code between server and browser?
Elia Schito
@elia
Oct 01 2014 17:21
Did happen a couple of times that I moved code from one to the other with little or no modification
George
@georgeu2000
Oct 01 2014 17:51
Is it possible to take HTML string and create HTML objects, operate on them using Opal-jQuery, and then append to the DOM?
For example:
html = "<div id='foo'><span class='bar'>bar</span></div>"
Here's my use case: Browser get JSON from the server, and has the html template (as above).
I want to add the JSON data to the html, and then append it to the DOM.
Elia Schito
@elia
Oct 01 2014 18:10
gotta go, will reply later
Elia Schito
@elia
Oct 01 2014 23:00
@georgeu2000 sure, with opal-jquery you can do everything you can do with normal jquery