I'm going crazy here. I'm trying to stop a link from being followed
after it's clicked. It works everywhere except Safari (using v. 2.0.2
on Tiger)


I'm using behavior.js to attach events based on a class or an id:

*******************************************************
function loadData(e) {
          // load some data here based on the url of the a tag
(removed for simplicity)

          // then stop the defaultevent
          if(e) {
                Event.stop(e);
            }
            return false;
}

var ajaxRules = {
        '.ajaxLink' : function(myAnchor) {
                // ... code to set up Ajax is up here (removed for simplicity)

             // put an event handler.
                Event.stopObserving(myAnchor, 'click', loadData, false);


        }
};

Behaviour.register(ajaxRules);
*******************************************************

Any idea what I'm doing wrong?

Thanks in advance.
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to