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 Developer
jdavidroberts
Posts: 7
Registered: ‎05-31-2009
My Device: Not Specified
Accepted Solution

script references and the hotspot browser

I'm finding that the hotspot browser doesn't seem to support a <script> tag that references a .js file?  See http://inthebagshoppinglist.com/testscriptref.htm.  This is a simple page that just references http://inthebagshoppinglist.com/test.js, which just pops up an alert.  I'm finding that in the HTML and Internet browsers it works great, but the hotspot browser doesn't seem to load the .js file.  The body onload event also pops a popup (correctly in all browsers assuming the JavaScript option is on), which proves that the hotspot browser can handle JavaScript.  It just seems to be the external file.

 

Anyone run into a problem with external Javascript and the hotspot browser?

 

To see the issue:

- Make sure Javascript and Javascript popups are enabled for all browsers.

- Make a bookmark for http://inthebagshoppinglist.com (I find that a bookmark is the easiest way to avoid accidentally getting the wrong browser).

- Set the bookmark for either HTML or Internet browser.

- Hit the page and you get two popups (one from body onload and one from test.js)

- Set the bookmark for the hotspot browser

- Hit the page and you just get the one popup from body onload

 

I have verified in the web logs that the hotspot browser is requesting test.js.  But for whatever reason it doesn't seem to process it.

 

Obviously you can do a view source to see the HTML, but for convenience here is the script reference:

 

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

Any ideas/suggestions?

 

To be clear, I'm really sure I have the JavaScript option enabled, plus if it weren't I wouldn't be getting any popups instead of just the one.

Please use plain text.
New Developer
jdavidroberts
Posts: 7
Registered: ‎05-31-2009
My Device: Not Specified

Re: script references and the hotspot browser

I forgot to mention that this is on a Bold 9000 v4.6.0.167
Please use plain text.
New Developer
blue_xii
Posts: 1
Registered: ‎06-19-2009
My Device: Not Specified

Re: script references and the hotspot browser

We had an issue with a Byte Order Mark (BOM) being placed at the beginning of the js file. It doesn't usually get displayed since it's technically binary information and not meant to be character data. We found it using Araxis Merge during a file comparison, you can check for it by using the DOS command TYPE to output the contents your js file to the command line. There should be three messed up characters at the beginning of the file if a BOM is present. In my case I got "". Anyways in our case this was preventing the external js files from working. Removing the BOM fixed the problem for us.

 

Good luck.

Please use plain text.
New Developer
jdavidroberts
Posts: 7
Registered: ‎05-31-2009
My Device: Not Specified

Re: script references and the hotspot browser

You rock, that was it, thanks a bunch.  Odd that it only breaks the hotspot browser, but regardless I have a workaround.
Please use plain text.