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: 7
Registered: ‎12-22-2010
My Device: Blackberry Storm 9550

body TAG's onload event not firing for my html pages developed using Visual Studio 2008(using blackberry plug-in 2.5)

 

 

<script language="javascript">body onload="init();"> 

 

function init()

{  alert('hi'); }

 

</script>

where init() method is not firing which is written in javascript in any HTML page in blackberry widget development using visual studio 2008 with blackberry plug-in 2.5 and i am testing my pages in blackberry simulator 9550 storm.

PLEASE HELP

Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: body TAG's onload event not firing for my html pages developed using Visual Studio 2008(using blackberry plug-in 2.5)

Hello,

 

The unload event was not supported prior to BlackBerry 6 (which introduced the WebKit browser rendering engine to the platform).  It will not occur on the 9550 simulator.

 

If you change the simulator to the BlackBerry Torch 9800, and retest your app, you should start seeing the unload event firing.

 

Sincerely,

Adam

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Developer
Posts: 164
Registered: ‎08-26-2010
My Device: Not Specified

Re: body TAG's onload event not firing for my html pages developed using Visual Studio 2008(using blackberry plug-in 2.5)

 


aspnetwidgetDEV wrote:

 

 

<script language="javascript">body onload="init();"> 

 

function init()

{  alert('hi'); }

 

</script>

where init() method is not firing which is written in javascript in any HTML page in blackberry widget development using visual studio 2008 with blackberry plug-in 2.5 and i am testing my pages in blackberry simulator 9550 storm.

PLEASE HELP


 

looks like you had did a syntax error in your scripts, for doing body onload event, it should be something like this:

 

 

<script language="javascript">

function init()

{  alert('hi'); }

 
</script>

<body onload="init();">

</body>

 

 

 

Contributor
Posts: 23
Registered: ‎05-11-2011
My Device: 9800 BOLD
My Carrier: Videotron

Re: body TAG's onload event not firing for my html pages developed using Visual Studio 2008(using blackberry plug-in 2.5)

Hi,

 

Your code should look more like this:

 

<script language="javascript">

function init()

{  alert('hi'); } 

</script>

 

<body onload="init();"> 

 

</body> 

 

P.S.:

Stan...Onload event not Unload