jquery ajax timing out

jquery ajax timing out

BY 22 May 2013 Web Application Development

I’m trying to do a simple ajax call (on ref device 210, Tizen 2.1) and it keeps timing out without a success or complete. The ref device is connected via wifi and I can surf to different sites. The window.open() function works fine as well,

Are there any special settings in the project I need to set to allow ajax calls? The code is html, jquery. Below is a code chunk that shows what I’m attempting:

var BaseURL = ‘https://api.intel.com:8081’;

function GetAuthCode(outPutText) {
    jQuery.support.cors = true;
    var URL = BaseURL + ‘/identity/v2/authcode’;
    var PostData = ‘state=’ + id + ‘&client_id=’ + APIKey;
    $(outPutText).val(“Requesting Authorization Code…”);
    $.ajax({
        url: URL,
        type: “POST”,
        data: PostData,
        dataType: “json”,
        success: function(data, textStatus, jqxhr) {
            console.log(“GetAuthCode() success”)
            $(outPutText).val(jqxhr.responseText);
            AuthCode = data;
        },
        complete: function(jqxhr, textStatus) {
            console.log(“GetAuthCode() complete: ” + textStatus);
            $(outPutText).val(textStatus);            
        },
        error: function(jqxhr, textStatus, errorThrown) {
            console.log(“GetAuthCode() error: ” + errorThrown);
            $(outPutText).val(“Error: “+errorThrown);
        },
        timeout: 60000
    });
}

Any help would be greatly appreciated,

-Chuck

Written by