Re: Embed clojurescript literals in server response

2012-04-24 Thread Evan Mezeske
> > Basically, I want to see what's possible. If someone's done the research > on how to do it this way, I'd like to see it. There's a different trade-off > being made with each method. > If you're looking for an example, the clojurescript browser REPL dynamically compiles forms and sends them

Re: Embed clojurescript literals in server response

2012-04-24 Thread Brent Millare
> > > $(function() {my_cljs_ns.initialize('data');}); > > > Today I coded up a method. Currently I'm creating divs of a class that is invisible. Then I just use some node searcher to grab the content then call read-string on it. Seems easier to do then inserting the javascript function cal

Re: Embed clojurescript literals in server response

2012-04-24 Thread Evan Mezeske
> > I would like to evaluate other methods which may involve: > -parsing hidden strings in the html code > The way that I've been doing this, for better or worse, has been to insert a Javascript function call into the HTML output by my server, like: $(function() {my_cljs_ns.initialize('data'

Re: Embed clojurescript literals in server response

2012-04-24 Thread Brent Millare
fetch uses goog.net.XhrIo under the hood, which has the disadvantage of making an additional request. My question is regarding on the initial request which includes the javascript, how can I send clojurescript literals, or is the best way to just parse existing clojurescript text embedded as ma

Re: Embed clojurescript literals in server response

2012-04-23 Thread kovas boguta
If you are using clojure on the backend, I'd look into https://github.com/ibdknox/fetch , it really simplifies things. It is possible to send compiled clojurescript data, though its harder to get up and running with that, and if you are only sending data (as opposed to functions) , it might not be

Embed clojurescript literals in server response

2012-04-23 Thread Brent Millare
I have some dynamically generated data that needs to be sent to the clojurescript code running on the page. Now I know there already exists the URL which can have query data (accessed via (. js/window -location) but has the disadvantage of requiring to be read in by the reader), and goog.net.Xh