2014-10-29 67 views
0

我有這樣的代碼JavaScript調用的Web API從遠程服務器

但它運行在本地主機上成功,但是當我試圖在遠程就拒絕

var parameters = { domainGuid:"test1",type:"testtype" }; 

    var url = "http://remote_server/api/controller_name/test_api"; 
// jQuery.support.cors = true; 
    $.ajax({ 
     url: url, 
     type: 'POST', 
     data: parameters, 
     async: false, 
     dataType: "json", 
     crossDomain: true, 
     success: get_all_videos_success, 
     error: get_all_videos_error 
    }); 

它去每次誤差函數

+0

你能發佈你得到的錯誤嗎? – kdlcruz 2014-10-29 14:45:48

+0

沒有錯誤它只是去錯誤功能,每次迴應總是有網絡錯誤 – eagels 2014-10-29 14:53:24

+0

即時通訊願意打賭這是一個CORS問題。 – 2014-10-29 14:53:58

回答

0

您是否嘗試將您的dataType從json切換到jsonp?