diff options
author | Mark Longair <mhl@pobox.com> | 2012-10-17 17:18:23 +0100 |
---|---|---|
committer | Mark Longair <mhl@pobox.com> | 2012-10-18 09:51:23 +0100 |
commit | 96fac4974cc9a88f9f3478f00e71c8ca780b4435 (patch) | |
tree | 4ea01d36818f94c621fa6082354ae5382b9188ed /www/cordova-independent.js | |
parent | 4a3105e612c7a612725f131b6d2a9079fcc3eb0e (diff) |
Automatically pick the right cordova-2.1.0.js
Diffstat (limited to 'www/cordova-independent.js')
-rw-r--r-- | www/cordova-independent.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/www/cordova-independent.js b/www/cordova-independent.js new file mode 100644 index 0000000..775ef4e --- /dev/null +++ b/www/cordova-independent.js @@ -0,0 +1,12 @@ +(function () { + var scriptElement = document.createElement("script"); + scriptElement.type = "text/javascript"; + if (navigator.userAgent.match(/(iPhone|iPod|iPad)/)) { + scriptElement.src = 'cordova-ios-2.1.0.js'; + } else if (navigator.userAgent.match(/Android/)) { + scriptElement.src = 'cordova-android-2.1.0.js'; + } else { + alert("Unknown platform - userAgent is: " + userAgent); + } + $('head').prepend(scriptElement); +})(); |