Ajax request Canceld in Tizen’s emulator, but not in browser

I currently have an error with my tizen emulator when I try to contact a webservice through $.getJSON.

I have a button, when I click on it, I get the JSON from a webservice, simple as that. On my computer browser, this works perfectly, but when I run the code as an app on Tizen’s emulator (gear), the GET method returns : (canceled)
Request cancelled.

Here’s the code (main.js):

$(window).load(function(){document.addEventListener('tizenhwkey', function(e) {
    if(e.keyName == "back")
        tizen.application.getCurrentApplication().exit();
});
$('.button').click(function(){
    getProductsOfUniverse(88);//Calls webservice
    return false;
});

function getProductsOfUniverse(universeId){
    //Works on desktop's Chrome
    $.getJSON( "http://192.168.1.240:8040/services/getProductsOfUniverse?rateMin=0&category="+universeId+"&customerId=", function( productJSON ) {
        var items = [];
          $.each( productJSON.product, function( key, val ) {
            items.push(
                    "<li> <div class="card_view">" +
                    "<div class="title"><strong>" + val.libelle + "</strong> </div>" +
                    "<div class="body">" + val.descriptionCourte + "</div>" +
                    "</div></li>" );
          });
          $('#ol_home_products').html(items);
        })
        .fail(function( err ) {
            //TODO Show error message
            console.log( err );
        });
}
});

I can see the cancel error in Networks’s tab, but nothing shows up in Console.
I don’t know where the problem is in Tizen gear emulator, the code works perfectly in browser.

Thanks.


Source: ajax

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.