Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Small refactor to injection of webworks.js

- changed to document.head
- added error handler and alert if things go south
  • Loading branch information...
commit d8204cc0f8f1f2e72d95b4c811caa0635bb05a84 1 parent 877fec1
@gtanner gtanner authored
Showing with 5 additions and 4 deletions.
  1. +5 −4 lib/scripts/bootstrap-blackberry.js
View
9 lib/scripts/bootstrap-blackberry.js
@@ -20,18 +20,19 @@
*/
document.addEventListener("DOMContentLoaded", function () {
- var wwjs;
switch(require('cordova/platform').runtime()) {
case 'qnx':
- wwjs = document.createElement("script");
- wwjs.type = "text/javascript";
+ var wwjs = document.createElement("script");
wwjs.src = "local:///chrome/webworks.js";
wwjs.onload = function () {
document.addEventListener("webworksready", function () {
require('cordova/channel').onNativeReady.fire();
});
};
- document.getElementsByTagName("head")[0].appendChild(wwjs);
+ wwjs.onerror = function () {
+ alert('there was a problem loading webworks.js');
+ };
+ document.head.appendChild(wwjs);
break;
case 'air':
require('cordova/channel').onNativeReady.fire();
Please sign in to comment.
Something went wrong with that request. Please try again.