下面的代碼運行alert(「Success」);當它獨立時,函數fSuccess被註釋掉,但它不會觸發fSuccess()函數。這是爲什麼?非常感謝您的參與。在jQuery中運行函數.When()。完成
$.when(chkUsername(), chkPassword()).done(function() {
if (boolusername == 0) {
$("#ErrorUN").css("display", "block");
}
else {
if (boolpassword == 0) {
$("#ErrorP").css("display", "block");
}
else {
$.ajax({
type: "POST",
url: "Registration.aspx/Success",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function() { }
});
}
}
}); //when
Imports System.Web.Services
Public Class Registration
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
<WebMethod()>
Public Shared Sub Success()
Dim strBreakPoint As String = "qwerty"
End Sub
末級
我發到服務器端代碼的一些變化,加上參考System.Web.Services和,我也把它改成一個共享的,現在它的工作原理。感謝大家的幫助。 –
2013-02-27 18:49:53