Software Archive
Read-only legacy content
Comunicados
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17060 Discussões

getJSON no longer working when using Intel XDK APP Preview

BRema
Novato
675 Visualizações

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 Solução
PaulF_IntelCorp
Funcionário
675 Visualizações

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.

Ver solução na publicação original

2 Respostas
PaulF_IntelCorp
Funcionário
676 Visualizações

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.

BRema
Novato
675 Visualizações

Paul! You're THE Best! Thx!

Responder