如何在客户端(javascript)调用服务器端的函数?
来源:百度知道 编辑:UC知道 时间:2024/04/29 06:23:26
objXmlHttp.open "GET","http://www.google.com",false
上面这一句中的http://www.qq.com改成我的服务器页名test.asp又不行,
高手们打救打救我吧
// Request to Server
// Declare constant
var requestHeader_urlencoded = "application/x-www-form-urlencoded;";
// Declare XMLHttpRequest
var xmlHttp;
// Declare backMethod
var backMethod
// Init XMLHttpRequest
function createXMLHttpRequest()
{
if( window.ActiveXObject )
{
xmlHttp = new ActiveXObject( "Microsoft.XMLHTTP" );
}
else if( window.XMLHttpRequest )
{
xmlHttp = new XMLHttpRequest();
}
}
------------------------------------------------------------
<script language="JavaScript">
function send()
{
// @HuLiejian 注释
var url = "login.do?curDate=" + new Date().getTime();
var xml = createXML();
createXMLHttpRequest();
xmlHttp.open( "post", url, true );
xmlHttp.onreadystatechange = handleStateChange;
xmlHt