12-15-2012 11:22 AM
I tried to get data from other server using xmlhttprequest.
When code run in simulator it's work perfectly, but when I try to run on Blackberry 10 Dev Alpha B it's always get empty response. (status = 0)
Solved! Go to Solution.
12-15-2012 12:06 PM - edited 12-15-2012 12:08 PM
Also I have a problem similar to your.
In ripple all works fine, but when I run my app on dev alpha all the XMLHttpRequest are not allowed.
see the attached image.
XMLHttpRequest are forbidden either in HTTP either in HTTPS, but if I invoke the browser from my app in dev alpha it opens the urls
in attachment there is also my config.xml (i've tried different solutions, but I didn't solve the problem).
Any idea or workaround?
12-15-2012 01:28 PM
I've got an A
Can you update your device to 1675 - everything appears to work on that version
I had all sorts of probs using 1103 but 1675 and gold SDK work perfectly on everything I throw at it
12-15-2012 02:19 PM
I've already installed the last OS dev Alpha, the SDK GOLD and bbui.js 0.95 .
This 's the best environment, but every ajax request is not allowed.
Either with unsigned bar either with a signed one!
I really can't understand.
Packagin and signing steps went OK, no warnning and no error.
12-15-2012 03:00 PM
I just ran up a quick little stupid app for demo purposes
I use JQuery as it's reliable
This very stupid app just echos whatever you send it
You can find the source here - change line 28 of index.html from Hello World to whatever you like and you get it back
I've kept everything in as few files as possible so the JS is in the header
The ZIP includes the script on the server side
The text comes out really tiny (I just wanted to get it working for you guys)
The doc, when loaded, calls http://safepear.com/junk.php when throws what it gets back into the xdom div
The important thing is setting the msg variable (Hello World) - change this to whatever you like
The script on the server takes msg and simply sends it back (boring)
Your variant of junk.php needs to take your proper input - do what you like with it - then return something JS can use
JSON is best if you're on PHP 5,3 or better as it can crunch an array into an object - takes a bit of experimentation though
I use exactly this process professionally and it never fails
The code in the example is a bit ropey as I wanted to keep it as short as possible
I use error checks and handshakes on real world stuff
The app will run out of the box
Simply kill junk.php, modify config.xml and change line 28 of index.html
Oh - again - stick a big font in index as well for #xdom
Done 4 builds to get it this far - not doing another just to make it pretty
12-17-2012 10:09 AM
I've tried your example app and it works fine.
But when I try to make HTTPS requests I get always the same error.
I'm sure that problems are in the config.xml file but I can't really understand how to configure the <access> element.
Have you one config.xml example file in which there're HTTPS access element?
12-17-2012 11:14 PM
12-18-2012 03:54 AM
FOUND THE SOLUTION
The problem was that in the used URL there was a email address that had not been encoded.
Tnx for the support