02-01-2013 05:50 PM
Anyone know how to get around this?
I'm running chrome with web security disabled (so it will do cross-domain requests).
Code:
$.getJSON(url, function(data) { ... });
Runs fine in bare Chrome but with Ripple enabled I get:
webworks.bb10 :: XMLHttpRequest :: setRequestHeader does not work with JSONP.
Any ideas?
Staff UI Prototyper (read: full-time hacker)
My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App
02-01-2013 05:56 PM
Hey Marco,
Have you tried using the basic $.get() JQuery method?
02-01-2013 06:02 PM
That's to fetch HTML dom elements...
Staff UI Prototyper (read: full-time hacker)
My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App
02-01-2013 06:06 PM
Hey Marco,
The file you are trying to retreive, won't that output json formatted text? You could then go on and do $.parseJSON(data) on the data that's retreived and go from there.
02-01-2013 06:09 PM
hey maco,
just an update -- this will probably yield you the same results:
$.get(url, data, callback, "json");
02-01-2013 06:10 PM
Yeah it's JSON. I'll try to go with regular AJAX and then parse it like you suggest. That said, I still don't understand why this is happening in Ripple but not in Chrome without Ripple... Makes no sense.
Staff UI Prototyper (read: full-time hacker)
My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App
02-01-2013 06:12 PM
Hey Marco,
I think it's happening because of the way Ripple handle's cross domain calls. It has this built in feature when it uses a Proxy server for all cross domain calls that devs make via their apps through ripple. This is in place for people who don't use the extra security arguments when loading up chrome. I think this "feature" is interfering with your development.
Chances are your code is perfectly fine and will run on the actual device. It's just the emulator that's giving you hiccups. Good luck!
02-01-2013 06:14 PM
Maybe you're right. I just tried changing it into using $.get() but I'm getting the exact same error.
Staff UI Prototyper (read: full-time hacker)
My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App
02-01-2013 06:22 PM
That's the strangest thing -- it shouldn't flare up with that issue because you aren't doing a JSON specific call. Is there anyway you can write out a sample of the code you are running? Just want to replicate it. Thanks!
02-01-2013 07:06 PM
Ok it's definitely Ripple ruining the party. Just installed it on device and it's working fine on there...
Staff UI Prototyper (read: full-time hacker)
My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App