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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Highlighted
Contributor
Posts: 11
Registered: ‎11-15-2012
My Device: Blackberry 10 Alpha Device
My Carrier: ATT
Accepted Solution

BB10 JQuery $ajax request: Javascript Alert Access to "http://mydomain.com/mypath" not allowed

If I try to use the following javascript:
        $.ajax({
            contentType: "application/json; charset=utf-8",
            url: 'http://mydomain.com/mypath',
            success: function(data, textStatus, jqXHR) {
                alert('cool')
            },
            cache: false,
            dataType: 'json'
        })
I get an JavaScript Alert that says Access to "http://mydomain.com/mypath" not allowed
I tried adding
<access uri="*" subdomains="true" />
to config.xml, but it had no effect. Not sure what else to do.
The above code works on IOS without any problems. I am using the BlackBerry 10 Emulator.
Does BB10 not allow cross domain ajax requests? Is there any way I can change this? BB10 JQuery $ajax request: Javascript Alert Access to "http://mydomain.com/mypath" not allowed bb10, ajax, jquery, javascript, not allowed
Contributor
Posts: 11
Registered: ‎11-15-2012
My Device: Blackberry 10 Alpha Device
My Carrier: ATT

Re: BB10 JQuery $ajax request: Javascript Alert Access to "http://mydomain.com/mypath" not allowed

I was able to get it to work using:
<access uri="*" subdomains="true" />
Contributor
Posts: 11
Registered: ‎11-15-2012
My Device: Blackberry 10 Alpha Device
My Carrier: ATT

Re: BB10 JQuery $ajax request: Javascript Alert Access to "http://mydomain.com/mypath" not allowed

I was able to get it to work using:
<access uri="http://mydomain.com" subdomains="true" />
New Contributor
Posts: 3
Registered: ‎04-20-2012
My Device: 9700 bold
My Carrier: Rogers

Re: BB10 JQuery $ajax request: Javascript Alert Access to "http://mydomain.com/mypath" not allowed

Thanks for the solution.  Works for me.. My first try was to have a last slash and with a port number :80 and that didn't work.  2nd try was to remote the port number and the last slash and it works. 

New Contributor
Posts: 3
Registered: ‎04-20-2012
My Device: 9700 bold
My Carrier: Rogers

Re: BB10 JQuery $ajax request: Javascript Alert Access to "http://mydomain.com/mypath" not allowed

I mean remove the port number and slash at the end. just the pure domain name.
New Contributor
Posts: 7
Registered: ‎12-29-2012
My Device: BB10
My Carrier: Vodafone

Re: BB10 JQuery $ajax request: Javascript Alert Access to "http://mydomain.com/mypath" not allowed

[ Edited ]

<access uri="*" subdomains="true" />

 

This is working not working for me in BB10. I need to add all the URL I am using in my project by using


<access uri="http://mydomain.com" subdomains="true" />