Community
cancel
Showing results for 
Search instead for 
Did you mean: 
BRema
Novice
75 Views

getJSON no longer working when using Intel XDK APP Preview

Jump to solution

Hi,

I'm trying to acces JSON-data on another server. My code works in the emulator and without the XDK (simply on a local webserver) but on my device it fails to get the JSON data.

I've added the following to the head in my index.html:

<script src="intelxdk.js"></script>
<script src="xhr.js"></script>

My javascript code is the following:

function get_market_list(){
    var url = "xxxxxxxxxxxxxx";
    $.getJSON(url, function(result, status, jqXHR){
        var data = $.parseJSON(jqXHR.responseText);
        var mlist = '<ul data-role="listview" data-inset="true">';
        $.each(data.response, function(index, val){
            mlist += '<li><a href="#" class="ui-btn" data-transition="slidefade" name="market_item" id="' + val.symbol + '">' + val.name + '</a></li>';
        });
        document.getElementById("mlist").innerHTML = mlist + '</ul>';
    });
}

The config-files have the default value:

<access origin="*"/>

Using Intel XDK: 3240

Everything works correct in: Chrome Browser on Laptop, Chrome Browser on Mobile Device (Android)

Don't know what settings I'm missing?

Kind regards,

Bart

Tags (2)
0 Kudos
1 Solution
PaulF_IntelCorp
Employee
75 Views

Please see this FAQ > https://software.intel.com/en-us/xdk/faqs/app-designer#ajax-jquery-one-fail < it likely is the source of your issue.

View solution in original post

2 Replies
PaulF_IntelCorp
Employee
76 Views

Please see this FAQ > https://software.intel.com/en-us/xdk/faqs/app-designer#ajax-jquery-one-fail < it likely is the source of your issue.

View solution in original post

BRema
Novice
75 Views

Paul! You're THE Best! Thx!

Reply