aboutsummaryrefslogtreecommitdiffstats
path: root/phonegap/www/cordova-independent.js
diff options
context:
space:
mode:
authorMark Longair <mhl@pobox.com>2012-10-17 17:18:23 +0100
committerMark Longair <mhl@pobox.com>2012-10-18 09:51:23 +0100
commitc66baa2664d01c17a683ff5d673035a5dd9b0a41 (patch)
tree3622b168f4d2cc1e38eee94b93bd1840967bd6e7 /phonegap/www/cordova-independent.js
parent79d83673f553ee0aab3c059da26502e00863a6b5 (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.js12
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);
+})();