Software Archive
Read-only legacy content
17061 Discussions

getJSON no longer working when using Intel XDK APP Preview

BRema
Novice
288 Views

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

0 Kudos
1 Solution
PaulF_IntelCorp
Employee
288 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

0 Kudos
2 Replies
PaulF_IntelCorp
Employee
289 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.

0 Kudos
BRema
Novice
288 Views

Paul! You're THE Best! Thx!

0 Kudos
Reply