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.

Posts: 116
Registered: ‎03-15-2011
My Device: Blackberry 9800
My Carrier: developer
Accepted Solution

xmlHttpRequest is returning no response in blackberry 10 webworks



I am using below link to send an http get request in blackberry webworks application. 




Calling updateContent (http://www.google.com) on click of button.


I have whitelisted the url in config.xml.

Now getting response as blank and req.status as 0.


Please let me know what I am doing wrong.



Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: xmlHttpRequest is returning no response in blackberry 10 webworks

[ Edited ]

Based on some testing:


<!DOCTYPE html>
		<script type="text/javascript">
			/*global window, document, console, alert, XMLHttpRequest */

			window.addEventListener('load', function () {
				var xhr;

				xhr = new XMLHttpRequest();
				xhr.open('GET', 'http://www.domain.com', true);
				xhr.onreadystatechange = function () {
				xhr.onload = function () {
			}, false);


Where I've substituted http://www.domain.com with various URLs, I am seeing a readyState 4, status 0 come up often when there is a security violation due to cross-domain requests. This is not something that can exactly be fixed on the client side if the server is denying that sort of access.


When I made the request to a domain on the same server that was hosting the above sample index.html, the request worked just fine.


You can test this further here:



Note that a request to http://www.google.com results in an error, while a request to https://cors-test.appspot.com/test succeeds.



EDIT: What this amounts to then is that the destination server likely is not allowing Cross-Origin requests, and you simply won't be able to make the request to that URL.

Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.