You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ti...@apache.org on 2013/03/28 00:03:21 UTC

[3/3] spec commit: [CB-2600] - fix for old blackberry

[CB-2600] - fix for old blackberry


Project: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/commit/b3caa3e8
Tree: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/tree/b3caa3e8
Diff: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/diff/b3caa3e8

Branch: refs/heads/master
Commit: b3caa3e87dfbb5c3a8e9a690d7a31fd6ae10fbbd
Parents: fd16116
Author: timkim <ti...@apche.org>
Authored: Thu Mar 21 16:06:50 2013 -0700
Committer: timkim <ti...@apche.org>
Committed: Wed Mar 27 16:03:09 2013 -0700

----------------------------------------------------------------------
 cordova.js |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/b3caa3e8/cordova.js
----------------------------------------------------------------------
diff --git a/cordova.js b/cordova.js
index 3d00979..c8017d6 100644
--- a/cordova.js
+++ b/cordova.js
@@ -41,13 +41,20 @@ if (PLAT) {
         var xhr = new XMLHttpRequest();
         xhr.open("GET", platformCordovaPath, false);
         xhr.onreadystatechange = function() {
+
             if (this.readyState == this.DONE && this.responseText.length > 0) {
-                cordovaPath = platformCordovaPath;
+                if(parseInt(this.status) >= 400){
+                    cordovaPath = versionCordovaPath;
+                }else{
+                    cordovaPath = platformCordovaPath;
+                }
             }
         };
         xhr.send(null);
     }
-    catch(e){} // access denied!
+    catch(e){
+        cordovaPath = versionCordovaPath;
+    } // access denied!
 }
 
 if (!window._doNotWriteCordovaScript) {