Rails 3 ajax hyperlink bindings -


i'm using rails 3 default javascript library (prototype, believe) , want render link makes ajax call when pressed.

here's sample haml code:

= link_to "test link", {controller: :information, action: :faq}, remote: true, id: "abc" :javascript   $("abc").bind('ajax:beforesend', function(){   alert('begin!');   }) 

right now, i'm testing code hand. idea should click on link , alert box should pop says "begin!" no alert dialog pops when click on hyperlink.

i've tried switch binding ajax:beforesend ajax:before, doesn't work either.

any ideas on i'm doing wrong?

thanks!

$("#abc").bind('ajax:beforesend', function(){

you missing # id


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -