2013-08-21 43 views
-1

我有一個簡單的jQuery請求如下所示:jQuery的阿賈克斯後沒有得到回報值

$.ajax({ 
     type : "POST", 
     contentType : "application/json", 
     url : 'http://localhost:8080/OTM/resteasy/location/coordinates/create', 
     data : jsonLatLon, 
     dataType : "json", 
     success : function(result){ 
      alert(result); 
     }, 
     error: function(err){ 
      alert(err); 
     } 
    }); 

螢火蟲當我看着我的控制檯,看到以下內容: POST:http://localhost:8080/OTM/resteasy/location/coordinates/create 後來當我展開它我看到了我期望看到的數據。但是,它永遠不會成功回撥。

任何想法爲什麼?

+1

瀏覽器控制檯中的任何錯誤?還有什麼是返回的數據 –

+1

當你看到JavaScript控制檯,你看到「拒絕訪問等等等等等相同的原產地政策等等等等」? –

+0

什麼是'jsonLatLon'? –

回答

-1
in alert you cant see json if you want to see 

then see in console you will see property of objects 

your response come in alert like 

alert(result.property); 
-1

你有'jsonLatLon'作爲你的數據源。你是否用你想傳遞的數據聲明變量?

否則就不會有任何回報。