Google Groups

Re: [Lift] Ajax adding onclick in HTML

Roch Delsalle Apr 30, 2012 2:45 PM
Posted in group: Lift
Hi Jeppe,

Yes that's exactly what I want to do,
Well, the reason why I want to use event listeners is because I think it's cleaner.
I guess it doesn't make such a big difference but I was wondering why Lift doesn't do it by default.

Thanks for your help,


2012/4/30 Jeppe Nejsum Madsen <>
On Mon, Apr 30, 2012 at 3:47 PM, Roch Delsalle <> wrote:
> Hi,
> I recently started using Ajax with lift. I noticed that lift is adding
> onclick="" attributes into the HTML it produces.
> I would like to know if lift is able to do it using Event Listeners ?

I assume you mean something like

element.addEventListener('click', function() { do ajax stuff }, false);

? If so, then no, not using the standard SHtml methods to generate the
HTML. But you can always construct your own event listeners and have
them perform the requested ajax call.

Out of curiosity, why would you rather use event listeners rather than
inline js?


Lift, the simply functional web framework:
Stuck? Help us help you: