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
Trusted Contributor
Posts: 103
Registered: ‎03-31-2011
My Device: Curve 9330
Accepted Solution

Trouble loading javascript from .js file

I have a .js file that has a function in it.

function startUp()
{
	openBISPushListener();
	jsonWelcomeMessage();
	setTimeout("checkCookie()",3000);
	loadCustomMenuItemsForPage();
}

 i call it in my body onload

<body onload="startUp()">

 I also have this tag on my html page

 <script type="text/javascript" src="scripts.js"></script>

 If the javascript is on the html page it works.  If I use it in firefox or chrome it works.  If I load it onto my 9330 curve os 6  it does not fire the javascript.

 

 

Developer
Posts: 1,055
Registered: ‎01-25-2009
My Device: BlackBerry Bold 9650/BlackBerry Torch 9800

Re: Trouble loading javascript from .js file

Are you receiving any errors? Try wrapping a try .. catch around the code inside your startUp function.
Jerome Carty - Follow jcarty on Twitter@jcarty | #webworks-dev / #BlackberryDev on irc.freenode.net | My Apps
Click "Accept as Solution" if post solved your original issue.. Give like/thumbs up if you feel post is helpful
Trusted Contributor
Posts: 103
Registered: ‎03-31-2011
My Device: Curve 9330

Re: Trouble loading javascript from .js file

try catch returns:

ReferenceError: Can't find variable: openBISPushListener

 

so its not finding the .js file?

 

Trusted Contributor
Posts: 103
Registered: ‎03-31-2011
My Device: Curve 9330

Re: Trouble loading javascript from .js file

got it.   I had some HIDDEN special characters in my js file.  Found it by using firebug addon in firefox.