> This is where I'm not exactly sure how tightly things are integrated between 
> Javascript and most frameworks.  I know that Rails supports jQuery and 
> Prototype, I believe, but I don't know exactly where they have them 
> integrated and for what purpose.

At one point in time, Rails was pretty tightly integrated with
Prototype...  Jquery seems to have come out on top in that space, so
now there's pretty strong support there too.

> The only integration I have so far is in a proc called ss_button that creates 
> a button widget, and you can do things like:
>
> ss_button delete -text "Delete This" -confirm "Are you sure you want to 
> delete this?"

> The -confirm option links into jQuery and pops up a confirmation dialog 
> before proceeding with the button if it exists.  Otherwise it just returns 
> and does nothing.  So far that's about the only actual integration I've 
> managed to come up with.  I'm using jQuery extensively on the site, but it's 
> just pure jQuery and has little or nothing to do with the Tcl code on the 
> backend.

The "done thing" these days seems to be this "unobtrusive javascript"
stuff, where you don't even include on onclick="...." function.  It's
a bit complicated to explain here, I'm not sure *I* get it 100%
myself, and I'm still not sold on it in any case, so I'll let you
google it.  Basically, you add extra attributes like data-confirm, and
then in your javascript .js file, you use those attributes to hang
onclick handlers on to the elements in question.

-- 
David N. Welton

http://www.welton.it/davidw/

http://www.dedasys.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to