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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Web and WebWorks Development

Reply
Contributor
tomitzel
Posts: 17
Registered: ‎01-04-2013
My Carrier: Orange

JavaScript Alert URL not allowed

Hello,

 

I use an api from http://api.idlight.net/lookup via AJAX, but in the simulator I get the javascript alert that I don't have access to that URL, although in the config.xml I've tried all variants of the access tag:

<access uri="http://api.idlight.net/lookup" subdomains="true" />

or

<access uri="http://api.idlight.net/" subdomains="true" />

or

<access uri="http://idlight.net" subdomains="true" />

 

But I still get that error, any ideas why?

Please use plain text.
BlackBerry Development Advisor
erikjohnzon
Posts: 236
Registered: ‎09-21-2012
My Carrier: Virgin

Re: JavaScript Alert URL not allowed

What is the exact alert? Is that webpage trying to load other resources as a cross domain request?

 

You are correct in your whitelisting logic as far as I can see.

@erikjohnzon
erjohnson@blackberry.com
Please use plain text.
Contributor
tomitzel
Posts: 17
Registered: ‎01-04-2013
My Carrier: Orange

Re: JavaScript Alert URL not allowed

It says:

Access to "http://api.idlight.net/lookup?q=test@test.com&key=kjgkdj4565kjbjh" not allowed.

 

 

I am trying to get some information from that api via a GET

Please use plain text.
BlackBerry Development Advisor
erikjohnzon
Posts: 236
Registered: ‎09-21-2012
My Carrier: Virgin

Re: JavaScript Alert URL not allowed

Scary, can you send me your config file by email? You are just doing a get from the webpage to that URL?

 

@erikjohnzon
erjohnson@blackberry.com
Please use plain text.
Contributor
tomitzel
Posts: 17
Registered: ‎01-04-2013
My Carrier: Orange

Re: JavaScript Alert URL not allowed

Email sent, thanks.

Please use plain text.
BlackBerry Development Advisor
erikjohnzon
Posts: 236
Registered: ‎09-21-2012
My Carrier: Virgin

Re: JavaScript Alert URL not allowed

The problem is the query contains the "@" symbol which is not a valid URI character. It should be % encoded. It should work otherwise :smileyhappy:.

@erikjohnzon
erjohnson@blackberry.com
Please use plain text.
Contributor
tomitzel
Posts: 17
Registered: ‎01-04-2013
My Carrier: Orange

Re: JavaScript Alert URL not allowed

Great, thanks!

Please use plain text.
Contributor
tomitzel
Posts: 17
Registered: ‎01-04-2013
My Carrier: Orange

Re: JavaScript Alert URL not allowed

Unfortunately, it does work even after I've encoded the charachter @ :smileysad:

I get:

Access to "http://api.idlight.net/lookup?q=test%40test.com&key=kjgkdj4565kjbjh" not allowed.
Please use plain text.