要实现Javascript调用页面静态方法,有下面几个前提
1. 方法必须是静态的
2. 方法必须标记为WebMethod
3. 方法没有参数
4. 不能从客户端传递数据过来(因为静态方法,无法读取到这些数据)--待进一步核实
5. 客户端必须用$.ajax,而不能用$.post
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="jquery-1.3.2-vsdoc.js" type="text/javascript"></script>