我的代码不起作用,我也不知道为什么。
我的Ajax代码调用:
var id = $(this).attr("data-id")
$.ajax({
type: "POST",
url: "XTM307.aspx/GetPart",
data: { "id": id },
contentType: "application/json",
dataType: "json",
success: function (response) {
}
});
我的服务器代码:
<System.Web.Services.WebMethod()>
<ScriptMethod(UseHttpGet:=True, ResponseFormat:=ResponseFormat.Json)>
Public Shared Sub GetPart(id As String)
Dim test = 2
test += 3
End Sub
答案 0 :(得分:0)
您的网络服务方法是const ws = new WebSocket("wss://example.com:80");
ws.onMessage = function(event){
ws.send("Hello, server");
executeAsync(longFunction());
}
function longFunction(){
//timeout 5 min
}
,因此ajax调用应类似于:
GET