What is the difference between them? I guess prevent default is not cross-browser. But if browser support, is stop() using it? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Event.stop does use event.preventDefault(), as well as event.stopPropagation(). These are both supported in DOM2, but IE does not support them. Prototype extends the default event object of IE to include these 2 methods. event.preventDefault() tells the current event to bypass the default operation it performs on the node. event.stopPropagation() stops the event from propagating beyond the node currently processing the event. Since Event.stop uses both, it completely stops the event, and as you noted, is cross browser compatible. Knox On Mar 8, 12:09 pm, Rauan Maemirov <rauan1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> What is the difference between them? I guess prevent default is not > cross-browser. But if browser support, is stop() using it?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks, that''s what I wanted to hear. On 9 мар, 02:00, knox <krowel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Event.stop does use event.preventDefault(), as well as > event.stopPropagation(). These are both supported in DOM2, but IE > does not support them. Prototype extends the default event object of > IE to include these 2 methods. > > event.preventDefault() tells the current event to bypass the default > operation it performs on the node. event.stopPropagation() stops the > event from propagating beyond the node currently processing the event. > > Since Event.stop uses both, it completely stops the event, and as you > noted, is cross browser compatible. > > Knox > > On Mar 8, 12:09 pm, Rauan Maemirov <rauan1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > What is the difference between them? I guess prevent default is not > > cross-browser. But if browser support, is stop() using it?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---