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
alwaysvip
Posts: 11
Registered: ‎11-15-2012
My Device: Blackberry 10 Alpha Device
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
alwaysvip
Posts: 11
Registered: ‎11-15-2012
My Device: Blackberry 10 Alpha Device

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
alwaysvip
Posts: 11
Registered: ‎11-15-2012
My Device: Blackberry 10 Alpha Device

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
minkydori
Posts: 3
Registered: ‎04-20-2012
My Device: 9700 bold

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
minkydori
Posts: 3
Registered: ‎04-20-2012
My Device: 9700 bold

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
JitendraKhetle
Posts: 7
Registered: ‎12-29-2012
My Device: BB10

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" />