Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Contributor
Posts: 16
Registered: ‎04-26-2011
My Device: Bold 9780
My Carrier: Vodafone Spain

Struggling with Cross Domain XMLHttpRequest calls from Simulator and Ripple

Hi!

I'm in the process of developing a BB webworks app that heavily uses xmlhttprequest to different domains.

The error I get is pretty funny/weird, let me explain it:

- when I compile the app for first time since I load Eclipse everything works ok, I canb in fact see the page I requested.

- As soon as I make any changes to the code and recompile for execution I get tjos nasty cross domain exceptions. The funny thing is that between recompiles I don't modify the code that performs the cross domain requests only some visual thibgs.

Could this be a bug in simulator?

When I try to execute my app on Ripple the result is even worse, it just does not work.

Any iddeas? Suggestins?

Thanks
Trusted Contributor
Posts: 227
Registered: ‎09-03-2010
My Device: Not Specified

Re: Struggling with Cross Domain XMLHttpRequest calls from Simulator and Ripple

 

you have the dominions in your safe list ?.
 you can publish the error message please

 

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Struggling with Cross Domain XMLHttpRequest calls from Simulator and Ripple

For cross origin AJAX calls or to bring in resources from other domains, you must white list your origins in the <access> elements in your app's config.xml file.

 

Ripple also follows these rules for AJAX calls.  Also Ripple only allows cross origin AJAX calls to domains that are accessible on the public internet.

 

This is one of the reasons why as we evolve the Ripple emulator that it will start to change from a Chrome plug-in into something even cooler :smileyhappy:

 

 

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Contributor
Posts: 16
Registered: ‎04-26-2011
My Device: Bold 9780
My Carrier: Vodafone Spain

Re: Struggling with Cross Domain XMLHttpRequest calls from Simulator and Ripple

Thanks Tim. I actually had already this sites on the "access" in config.xml. It only happens that some emulator versions are a bit clumsy and don't work so well as expected.

I downloaded latest version of simualtor for 9780 and works like a charm :-)

Looking forward for this new and cool Ripple features!

Thanks!
BlackBerry Development Advisor (Retired)
Posts: 5
Registered: ‎07-12-2011
My Device: Required Field
My Carrier: Required Field

Re: Struggling with Cross Domain XMLHttpRequest calls from Simulator and Ripple

[ Edited ]

Not sure if it will help (with Ripple issues), but If you are still wanting a less restrictive XMLHttpRequest object (specially when running in file://), you can check out this post here:

 

http://ripple.tinyhippos.com/forums/3-ripple/topics/36-disabling-web-security-in-chrome-for-cross-do...

 

Cheers,