05-14-2012 09:02 AM - edited 05-15-2012 05:42 AM
I am using XMLHttpRequest to call a REST services.
When testing is under Mozilla and Chrome everything works just fine.
Although, when I enabled the Ripple under Chrome it stopped working. After some debugging I found out that in the switch/case statement, where I do something like ...
switch (this.readyState) {
case XMLHttpRequest.DONE: ... some code here ... break;
}... the "case" does not get fired.
Closer examination determined that all the values XMLHttpRequest.* are undefined so that is the reason my code stopped working.
Q: Why XMLHttpRequest readyState values, otherwise well defined, become undefined under Ripple?
Are there any solutions for that issue, other than using plain numbers like 1, 2, 3, 4 or defining the values myself.
Solved! Go to Solution.
05-18-2012 04:25 AM
Here is a testing script that I've used to determine the poblem above ...
<html>
<body>
<div id="log"></div>
<script type="text/javascript">
document.getElementById("log").innerHTML = "XMLHttpRequest.DONE=" + XMLHttpRequest.DONE + "<br />\n";
</script>
</body>
</html>Under Chrome it gives XMLHttpRequest.DONE=4
Under Ripple it gives XMLHttpRequest.DONE=undefined
05-18-2012 04:26 PM
Are you using the latest version of Ripple - the Chrome extension beta? I just tested and the value is there.
05-22-2012 07:47 AM
Here are different environments I use to test:
(1)
Google Chrome 19.0.1084.46 m
Ripple Mobile Environment Emulator (Beta) 0.9.3
Settings: Platform=WebWorks, Device=Torch
Test: fail ... XMLHttpRequest.DONE=undefined
(2)
Ripple 0.9.0.16
Ripple Mobile Emulator (v0.9.1)
Ripple UI (v0.9.2)
Ripple Framework (v0.9.1)
Ripple Build & Deploy (v0.9.0)
Settings: Platform=WebWorks, Device=Torch
Test: fail .... XMLHttpRequest.DONE=undefined
05-22-2012 03:12 PM
Please try with 0.9.4 which is what I'm running.
06-06-2012 04:35 AM
After installing the Ripple Emulator (Beta) 0.9.5 the script passes the test.
Looks like you have to download the Ripple from https://developer.blackberry.com/html5/downloads/r
Thanks.