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
o0
Contributor
o0
Posts: 26
Registered: ‎05-13-2010
My Device: developper...
My Carrier: developper...
Accepted Solution

XMLHttpRequest DOMException #18 (SECURITY_ERR)

I'm testing the same App within a Web Widget and inside the native BlackBerry Web Browser, and I'm getting strange security errors on the Web version.

 

I'm using XMLHttpRequests, and my understanding is that those are allowed as long as the script that makes the request is hosted on the same server as the service it is requesting the data from.

 

In my case I get a DOMException #18 (SECURITY_ERR) eventhough both the script and the ressource it's accessing are in the same domain (and subdomain)

 

Of course, the frustrating thing is that the same code on both iPhone and Android (and of course a desktop browser) works flawlessly.

 

Is it possible that this error is in fact masking a different problem with the BlackBerry browser? Tested with both the Simulator with 9550 (5.0.0.469) and a real device...

 

Help!

Please use plain text.
o0
Contributor
o0
Posts: 26
Registered: ‎05-13-2010
My Device: developper...
My Carrier: developper...

Re: XMLHttpRequest DOMException #18 (SECURITY_ERR)

Ok for the benefit of other developpers. The BlackBerry browser doesn't support the W3C Cross-Origin Resource sharing standard :-( (http://www.w3.org/TR/cors/)

 

But it seems it's apply cross origin to the location of the html file, not the script...

 

I'm serving everything from a single host thanks to some apache magic.

 

oO

 

 

Please use plain text.
Contributor
zacksam86
Posts: 10
Registered: ‎10-25-2011
My Device: bold
My Carrier: fido

Re: XMLHttpRequest DOMException #18 (SECURITY_ERR)

Hi oO,

 

Did you find a solution to this? I am experiencing the same issue.

 

Regards,

Zaid

Please use plain text.