Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Regular Contributor
Posts: 55
Registered: ‎12-23-2011
My Device: 9900 / PB 2.0641
My Carrier: SFR

HTML5 Element Touch event - is that a typo ?

[ Edited ]

in HTML5 Element Touch Event documentation page, sample "prevent move" :

 

preventMove = function(e) {
   evt.preventDefault();
   window.scroll(0, 0);
   return false;
};
window.document.addEventListener('touchmove', preventMove, false);

 1st line should be :

preventMove = function(evt) {

 Moreover, for examples consistency, maybe a choice between "evt" or "event" could be used to ease understanding and noobs (I)  copy/paste adaptation Smiley Wink

 

Or maybe I missed something ?

Highlighted
Developer
Developer
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: HTML5 Element Touch event - is that a typo ?

Hi superfly_fr,

 

you are really right with all your thoughts, even the "evt" attribute for event parameters is a good point for consistency and readability of source code. One point, I think you are referring to this URL, isn't it: https://developer.blackberry.com/html5/api/Element.html


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Regular Contributor
Posts: 55
Registered: ‎12-23-2011
My Device: 9900 / PB 2.0641
My Carrier: SFR

Re: HTML5 Element Touch event - is that a typo ?

Yes !

And thanks for the link, edited.