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
Developer
panchopepe
Posts: 30
Registered: ‎06-22-2012
My Device: Blackberry Curve 8520

Javascript Alert

Hello I am developing a blackberry playbook's apps, I create a icon of twitter with a link to twitter's user, in my chrome browser I click on the icon and open the twitter of the user,  but when I install the apps in the simulator , and I try to open twitter doing clik in the twitter icon, the tablet show me a  javascript alert message  window that says http://twitter/user  not allowed, please I need help, to solve this problem thanks attach send screen capture 

Developer
rorybarnes
Posts: 214
Registered: ‎01-07-2011
My Device: Bold 9900

Re: Javascript Alert

Did you whitelist the URL in your config.xml? Any time you access an outside URI it needs to have an <access> element.

 

https://developer.blackberry.com/html5/documentation/access_element_834677_11.html

 

R

--
Rory (@roryboy)
Click "Accept as Solution" if post solved your original issue. Give like/thumbs up if you feel post is helpful
Developer
panchopepe
Posts: 30
Registered: ‎06-22-2012
My Device: Blackberry Curve 8520

Re: Javascript Alert

Hi! below describes my config.xml

 

?xml version="1.0" encoding="utf-8"?>
<widget xmlns="http://www.w3.org/ns/widgets"
xmlns:rim="http://www.blackberry.com/ns/widgets"
version="1.0.0.0" id="VSPH">
<name>Viajando Sin PH</name>
<author>Francisco Ochoa</author>
<description>Consejos a mochileros</description>
<icon src="images/icono.png"/>
<content src="index.html"/>
<rim:smileytongue:ermissions>
<rim:smileytongue:ermit>access_shared</rim:smileytongue:ermit>
<rim:smileytongue:ermit>read_geolocation</rim:smileytongue:ermit>
</rim:smileytongue:ermissions>


<feature id="blackberry.ui.dialog"/>

<access uri="http://www.youtube.com" subdomains="true">
<feature id="blackberry.app.event"/>
<feature id="blackberry.invoke"/>
</access>
</widget>

 

thanks

Developer
Developer
LBP
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: Javascript Alert

Twitter seems to not be whitelisted in your config.xml, try to add it like you added youtube.com. You could also use

 

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

but you may not want to whitelist the whole web. Adding the follwoin should give you access to Twitter:

 

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

 


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.