日期:2014-05-18  浏览次数:20757 次

小弟有个问题请教大家!页面中有大量的INPUT,载入后在INPUT间切换速度极慢!
本人做了一个页面,显示大量的数据,并且要求在本页修改数据,所以用了大量的INPUT(大概6000个),载入速度比较慢,但还可以容忍,可是载入后,在INPUT之间切换焦点,非常慢,有时还会死机:(
由于数据比较多,用了以下格式:
  ListHtml+= " <div   id=the10Div   style=\ "height:400;overflow-x:hidden;overflow-y:auto;\ "   onscroll=   \ "the11Div.scrollTop=scrollTop   \ "   > ";
ListHtml+= " <table   id=the10Table   width= '100% '   cellspacing= '1 '   border= '0 '   cellpadding= '0 '   style= 'background-color:#E4E5EE '   > ";
             

ListHtml+= " </table> </div> </td> <td> "   ;
ListHtml+= " <div   id=the11Div   style= '   width:650;height:400;overflow-x:auto;overflow-y:hidden; '       > "   ;
ListHtml+= " <table   id=the10Table   width= '100% '   cellspacing= '1 '   border= '0 '   cellpadding= '0 '   style= 'background-color:#E4E5EE '> "   ;
ListHtml+= " <tr   class= 'tableHead '   style=\ "top:expression(document.getElementById( 'the11Div ').scrollTop)\ "> "   ;

请各位高手指教!!谢谢!

------解决方案--------------------
CSDN一般都是1个小时左右才有人回帖的,不像灌水论坛这么快

我刚才试一下,我写了个循环产生10000个INPUT,也不怎么卡啊,不知道你的为什么。

代码如下

<%@page contentType= "text/html;charset=gb2312 "%>

<%
int i = 10000;
while(i> =0)
{
out.print( " <input type=text> ");
out.print( " <br> ");
i--;
}
%>