0
我有以下功能它假設與另一臺服務器交談檢索json數據並顯示它的問題是該函數甚至沒有啓動一個查詢我是我在做什麼w??該代碼被上傳到Apache Tomcat服務器,我使用Wireshark的用於跟蹤和這裏有沒有HTTP端口上的代碼是jquery/ajax json數據功能不工作
$(document).ready(function() {
var home_add='http://wcf.net:3300/gateway';
$('#handshake').click(function(){
alert(" sending json data");
function handshake(){ /*testing the function */
var data_send = {
"supportedConnectionTypes": "long-polling",
"channel": "/meta/handshake",
"version": "1:0"
};
$.ajax({ /* start ajax function to send data */
url:home_add,
type:'POST',
datatype:'json',
contanttype:'text/json',
async: false,
error:function(){ alert("handshake didn't go through")}, /* call disconnect function */
data:JSON.stringify(data_send),
success:function(data){
$("p").append(data+"<br/>");
alert("successful handshake")
}
})
}
})})
預先感謝您的反饋 熔岩
你好,謝謝你的回覆我跟着你的反饋,但它仍然不工作:( – Lava 2010-12-20 19:19:57