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
New Contributor
Posts: 6
Registered: ‎03-23-2010
My Device: SmartPhone
My Carrier: Verizon

how to use addEventListener

Can someone give an example of how to make addEventListener work on the Blackberry browser?  I am using the 9550 simulator.

 

Many questions in this forum get referred to the documentation. 

 

However, the Blackberry Browser Javascript  Reference contains no examples.  And so even though addEventListener is documented, I am unable to make it work and need some example code.

 

 

 

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: how to use addEventListener

An example to listen for the load would look like the following:

 

 

window.addEventListener("load", function(e) { alert("loaded"); }, false );

 

 

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter