[Prototype-core] Re: Event methods' bug in Internet Explorer

2007-10-11 Thread Tom

Matt,
   it definitely does fail in IE, because stop is implmented as

  stop: function(event) {
event.preventDefault();
event.stopPropagation();
  }

  preventDefault and stopPropagation are 2 of the functions added to
the Event object in IE when it is extended so they dont exist on the
native IE event passed.

Tom

On Oct 9, 1:54 pm, Matt Foster [EMAIL PROTECTED] wrote:
 You sure that will fail?  I am pretty sure the static event methods
 should all work with a regular event object.

 Isn't it just for convenience, like the Element methods that they put
 Evethe method in as a property just for the syntactic sweetness?

 Also I agree with Mislav, inline event handling is horrible practice.
 Gather your elements and apply listeners, similar to how you avoid
 inline markup because of CSS, now you can avoid inline markup for
 javascript behavior because of prototype.  I find myself using the
 same selectors in these two technologies constantly and i'll tell you,
 when you come back to it a few months later you'll be happy.

 Cheers,
 Matt

 On Oct 2, 8:26 am, Mislav Marohnić [EMAIL PROTECTED]
 wrote:

  On 10/2/07, Viktor Kojouharov [EMAIL PROTECTED] wrote:

   The above snippet will cause an error in IE due to the reason that the
   event is never extended, since it doesn't go through the observe
   wrapper.

   A possible solution for this is to use the old syntax of
   Event.method(event) inside prototype itself. Or call
   Event.extend(event) at the beginning of each method.

  Exactly. Or simply return false when you are using inline event handling.
  You shouldn't use inline anyway, it's bad practice.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Re: Event methods' bug in Internet Explorer

2007-10-09 Thread Matt Foster

You sure that will fail?  I am pretty sure the static event methods
should all work with a regular event object.

Isn't it just for convenience, like the Element methods that they put
the method in as a property just for the syntactic sweetness?

Also I agree with Mislav, inline event handling is horrible practice.
Gather your elements and apply listeners, similar to how you avoid
inline markup because of CSS, now you can avoid inline markup for
javascript behavior because of prototype.  I find myself using the
same selectors in these two technologies constantly and i'll tell you,
when you come back to it a few months later you'll be happy.

Cheers,
Matt




On Oct 2, 8:26 am, Mislav Marohnić [EMAIL PROTECTED]
wrote:
 On 10/2/07, Viktor Kojouharov [EMAIL PROTECTED] wrote:



  The above snippet will cause an error in IE due to the reason that the
  event is never extended, since it doesn't go through the observe
  wrapper.

  A possible solution for this is to use the old syntax of
  Event.method(event) inside prototype itself. Or call
  Event.extend(event) at the beginning of each method.

 Exactly. Or simply return false when you are using inline event handling.
 You shouldn't use inline anyway, it's bad practice.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Re: Event methods' bug in Internet Explorer

2007-10-02 Thread Mislav Marohnić
On 10/2/07, Viktor Kojouharov [EMAIL PROTECTED] wrote:


 The above snippet will cause an error in IE due to the reason that the
 event is never extended, since it doesn't go through the observe
 wrapper.

 A possible solution for this is to use the old syntax of
 Event.method(event) inside prototype itself. Or call
 Event.extend(event) at the beginning of each method.


Exactly. Or simply return false when you are using inline event handling.
You shouldn't use inline anyway, it's bad practice.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---