急死我了,高手们来看看啊
我是在.net环境中用的ajax.dll,目的是在用户文本框输入字符的时候用Ajax动态从库里取出数据生成div,给用户一个智能提示(就像中搜mp3那样),以前的需求是点击div里的数据,把数据给文本框就行了,没有任何问题,现在需求改了,点击后要跳转页面,就有问题了
这是我动态生成div的javascript代码,ds为从库的取出的数据,SelectDivItem('"+Pro_Id+"')为点击事件触发的方法
for(var i=0; i<ds.Tables[0].Rows.length; i++)
{
//document.all.textfield.value = ds;
var Pro_Name =ds.Tables[0].Rows.Pro_Name;
var Pro_Id = ds.Tables[0].Rows.Pro_Id;
var Price_B = ds.Tables[0].Rows.Price_B+"元";
Str += "<table class=\"f12\" width=99% border=0 cellpadding=0 cellspacing=0 height=\"20\" ";
Str += "onMouseOver=\"MouseMoveIn("+i+","+ds.Tables[0].Rows.length+")\" ";
Str += "onMouseOut=\"MouseMoveOut("+i+")\" ";
这行注意!!! Str += "onMouseDown=\"SelectDivItem('"+Pro_Id+"')\"";
Str += "><tr>";
//Str += "<td width=20% align=left class=\"f13\" id=\"td"+i+"_1\" style=\"padding-left:4px;font-size: 12px;; cursor:hand;\">";
//Str += Pro_Id;
//Str += "</td>";
Str += "<td width=50% align=left class=\"f14\" id=\"td"+i+"_2\" style=\"padding-left:2px;font-size: 12px;; cursor:hand;\">";
Str += Pro_Name;
Str += "</td>";
Str += "<td width=30% align=left class=\"f14\" id=\"td"+i+"_3\" style=\"padding-left:2px;font-size: 12px;; cursor:hand;\">";
Str += Price_B;
Str += "</td>";
Str += "</tr></table></div>";
Str = Str.replace("undefined","");
}
SelectDivItem('"+Pro_Id+"')为点击事件触发的方法,代码中该方法处有标志~~~
问题是:我想在该方法写跳转的语句
function SelectDivItem(strWord)
{window.location.href="ProductDetail.aspx?Pro_Id="+strWord;}
在运行时我点击div中的数据后,就会漫长的等待后,出现这一句:
超时时间已到。在操作完成之前超时时间已过或服务器未响应。的错误
我考虑的是:上面的方法是写在回调函数里的,是不是,我的回调函数没有执行完,系统还在不停的调用我ajax类的某个方法?向ajax高手请教,这里如何实现跳转~~~~~~
|