100分!ajax请求错误
C# code:
<script type="text/javascript">
window.onload=function()
{
startRequest('get','../College.ashx','lxyc=2&time='+new Date().getTime()+'',ShowIt,true);
}
var xmlHttp1;
function createXMLRequest()
{
if(window.ActiveXObject)
{
xmlHttp1=new ActiveXObject("Microsoft.XMLHTTP");
}
else if(window.XMLHttpRequest)
{
xmlHttp1=new XMLHttpRequest();
}
else
{
alert("不能创建XMLHttpRequest");
}
}
function startRequest(method,url,pars,callbackfun,cache)
{
// alert(method+url+pars+callbackfun+cache);
if(typeof callbackfun != 'function'){
alert('The CallBackFun is not a function!');
}
if(cache){
pars += "&tmp="+Math.random();
}
createXMLRequest();
xmlHttp1.onreadystatechange = function(){
if(xmlHttp1.readyState==4)
{
if(xmlHttp1.status==200)
{
callbackfun(xmlHttp1);
xmlHttp1.abort();
}
else
{
xmlHttp1.abort();
相关问答:
一html页面数据如下:
<ul>
<li>aaa </li>
<li>bbb </li>
<li>ccc </li>
</ul>
通过JQ的ajax方法之后,得到的竟然变成了:
......
<!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/xht ......
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1&q ......
现在用的功能相当于选项卡,之前的使用js控制层的现实来识别的,函数如下
JScript code:
function showDiv(id,num)
{ for(i=1;i<=num;i++) {
var currentId="div"+i;
......