Click here to Skip to main content
11,927,422 members (46,543 online)
Rate this:
Please Sign up or sign in to vote.
I have a problem with my phonegap project working on blackberry simulator. The version is 10.
When I say phonegap, I haven't used any Cordova features yet but my simple javascript functions are not working in the first place.
I have a button click which invokes a Javascript function. This JS function has a PHP as URL to retrieve data. Following is the function code -
<pre lang="Javascript">function getAllDetails() {
  var myTable = '';
    myTable += '<table id="myTable" cellspacing=0 cellpadding=2 border=1>';
    myTable += "<tr><td><b>S.No.</b></td><td><b>Full Name</b></td><td><b>DOB</b></td><td><b>Gender</b></td><td><b>Address</b></td><td><b>Image</b></td><td><b>Video</b></td></tr>";
    var url = "http://XXX.XXX.XX.XX:XX/PG_crud_experiment1/retrieve_all.php";
    $.getJSON(url, function(json) {
                $.each(json, function(i, v) {
                            myTable += "<tr><td>" + + "</td><td>"
                                    + + "</td><td>" + v.dob
                                    + "</td><td>" + v.address + "</td><td>"
                                    + v.image + "</td></tr>";

The problem here is my button click is entering the Javascript function but I am getting an error saying it cannot access the URL where my PHP file is placed. The PHP is actually running a SELECT SQL and retrieving values from a database.

Can anyone please tell me why this problem is coming up? Are there any pre-requisites/procedures to be followed before the device can run some Javascript functions or to access the PHP scripts on server?XXX
Posted 18-May-13 1:31am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

The solution is to edit the config.xml file of the project -
add the tag
<access subdomains="true" uri="http://*URI name here*" />
Only then, Blackberry allows access permissions to a different domain.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.151126.1 | Last Updated 18 May 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100