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 | c66baa2664d01c17a683ff5d673035a5dd9b0a41 (patch) | |
tree | 3622b168f4d2cc1e38eee94b93bd1840967bd6e7 /phonegap/www/cordova-independent.js | |
parent | 79d83673f553ee0aab3c059da26502e00863a6b5 (diff) |
Automatically pick the right cordova-2.1.0.js
Diffstat (limited to 'phonegap/www/cordova-independent.js')
-rw-r--r-- | phonegap/www/cordova-independent.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/phonegap/www/cordova-independent.js b/phonegap/www/cordova-independent.js new file mode 100644 index 000000000..775ef4e4f --- /dev/null +++ b/phonegap/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); +})(); |