The following code does NOT work in Internet Explorer 6.0 but works fine both in Opera 9 and Firefox2: ====================<script type="text/javascript" defer="defer" src="js/prototype.js"></ script> <script type="text/javascript" > function checkKey(e) { if (e.keyCode == Event.KEY_UP) { alert(''up''); } if (e.keyCode == Event.KEY_DOWN) { alert(''down''); } } Event.observe(window, ''load'', function() { Event.observe(''id'', ''keydown'', checkKey); }); </script> Hi <input type=''edit'' name=''n'' id=''id''> ==================== what can be done to make it work in Internet Explorer properly? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2007-Apr-11 10:05 UTC
Re: keyboard events handling in internet explorer
Hey there,> what can be done to make it work in Internet Explorer properly?Perhaps changing the type= attribute to "text," which is a valid value? Untested, but first thing I''d change. -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Apr 11, 7:38 pm, "asv" <averya...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> The following code does NOT work in Internet Explorer 6.0 but works > fine both in Opera 9 and Firefox2: > ====================> <script type="text/javascript" defer="defer" src="js/prototype.js">Why suggest to the browser that it defer executing a 90Kb library when immediately after this element you are about to use that library? <UR: http://www.w3.org/TR/html4/interact/scripts.html#adef-defer > [...]> > what can be done to make it work in Internet Explorer properly?Remove the defer attribute, it serves no useful purpose here and is generally ignored by (all?) browsers other than IE. -- Rob --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Apr 11, 8:05 pm, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote: [...]> Perhaps changing the type= attribute to "text," which is a valid value? > Untested, but first thing I''d change.The default value for an input element''s type attribute is text, so it shouldn''t make any difference. <URL: http://www.w3.org/TR/html4/interact/forms.html#edef-INPUT > -- Rob --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
IE doesn''t pass the (e) event object to event handlers automatically unless you are using Event.Observe to attach your handler (prototype way). You''ll need to go if(!e) e=window.event; But be aware this still isn''t cross browser because not all browsers that don''t pass (e) have window.event. Gareth On 4/12/07, RobG <rgqld-AFFH1GffN5hPR4JQBCEnsQ@public.gmane.org> wrote:> > > On Apr 11, 8:05 pm, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote: > [...] > > Perhaps changing the type= attribute to "text," which is a valid value? > > Untested, but first thing I''d change. > > The default value for an input element''s type attribute is text, so it > shouldn''t make any difference. > > <URL: http://www.w3.org/TR/html4/interact/forms.html#edef-INPUT > > > > -- > Rob > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Apr 12, 7:20 am, "Gareth Evans" <agr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> IE doesn''t pass the (e) event object to event handlers automatically unless > you are using Event.Observe to attach your handler (prototype way).What are you replying to? Event.observe hasn''t been mentioned in this thread - I''ve mentioned it in other threads, but you seem to have misunderstood my point. If you wish to discuss it I''m happy to do so, but only in the related thread so arguments retain their context. -- Rob --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
odd, it was another thread completely i replied to - i reply using gmail rather than groups, so it probably screwed up. I wouldn''t worry. On 4/12/07, RobG <rgqld-AFFH1GffN5hPR4JQBCEnsQ@public.gmane.org> wrote:> > > On Apr 12, 7:20 am, "Gareth Evans" <agr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > IE doesn''t pass the (e) event object to event handlers automatically > unless > > you are using Event.Observe to attach your handler (prototype way). > > What are you replying to? Event.observe hasn''t been mentioned in this > thread - I''ve mentioned it in other threads, but you seem to have > misunderstood my point. If you wish to discuss it I''m happy to do so, > but only in the related thread so arguments retain their context. > > > -- > Rob > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---