Firstly, thank you Clojure/core team and other contributors for this
exciting project.

I have a small problem I've encountered while building a simple
personal blog, as an exercise, with Clojure/ClojureScript and would
appreciate any feedback.

I have a client-side function that sends a request to a specific URI
on the server-side that respondes with an HTML fragment/snippet.
The request event is received by the front-end callback function and
it simply "replaces" a specific HTML node with the HTML fragment
received from the server side.

The Cljs code:
https://gist.github.com/1102641

Upon the request from the client-side code, I can confirm that the
server successfully responds with the HTML fragment as shown in the
example below:

<div id="essay">
      <div class="entry">
        <h3 class="subject">Content sub-heading</h3>
        <div class="body">Content...</div>
        <div class="meta-data">[Meta-data]</div>
      </div>
      <div class="entry">
        <h3 class="subject">Content sub-heading 2</h3>
        <div class="body">Content 2...</div>
        <div class="meta-data">[Meta-data]</div>
      </div>
</div>

Line 15 in the cljs script is meant to replace the HTML node with the
HTML fragment received from the server above.
Instead, the result is an unevaluated anonymous function below:

function (){try{return this.a?this.a.responseText:""}catch(a){return
E(this.e,"Can not get responseText: "+a.message),""}}

If I replace the (-> % .target .getResponseText) on line 16, with a
simple hardcoding, "<div id='essay'>Test</div>", everything works as
expected.

To conclude, I have tested the entire cljs script, and it works as
expected, with an exception to (-> % .target .getResponseText) on line
16.

Do I perhaps have to force the evaluation of the returned anonymous
function or is there some special ClojureScript macro/function that I
omitted from the process?

-Alen

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to