Yes Lift's JavaScript stuff is mostly used when returning Ajax
response. You can also use it to serve fictive *.js files and instead
of returning a js file content you can serve the request (using
LiftRules.dispatch) and the actual JS returns is produced by
composition of JsCmd-s. We actually do that when serving the
"primordial" lift-ajax/comet script.

You can also use them for js events just to do some client stuff
without invoking ajax. This is pretty handy as where you compute your
button content from a snippet you can easily attach JS behavior as
well.


Br's,
Marius

On Feb 1, 2:27 am, "[email protected]" <[email protected]>
wrote:
> HI all,
>
> first of all, I should present myself, as it's my first post in the
> group: I'm Pere Villega, a Java developer living in Dublin and
> learning Scala and Lift in my spare time.
>
> As a good newbie, I'll start with an obvious question: I've been
> reading the Lift book, and I got confused on the javascript section.
> It seems Lift allows you to create javascript code on the server side,
> but as far as I understand this code is only to be used when reacting
> to events that go to the server? Or I'm mistaken?
>
> So, to say it in another way, if I have a page that has javascript,
> the lift way is to keep in the template all the javascript that
> modifies the UI (like a button that hides a div but doesn't send any
> data to the server) and keep on the snippets the code that will
> eventually relate to calls to the server (like an onclick validation
> on submit or an ajax call). Is that correct?
>
> I know it might seem obvious, but I would hate to start doing it that
> way and then discover I could have saved effort using the lift
> calls... :)
>
> Best regards,
> Pere Villega

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.

Reply via email to