table

jsp ajax 延迟加载..

<html>
<script language="javascript">
function aaa(){
setTimeout("showComment('<%=request.getParameter("userid")%>')",5000) ;    //延迟加载
}
function showVistor(){
document.getElementById("objID").innerHTML="加载完毕";
}
function showComment(userid){
var ajaxobj=new AJAX();
ajaxobj.method="GET";
ajaxobj.url="blogProcess.jsp?action=showComment&userid="+userid;
ajaxobj.callback=function(){
    $F("commentcon",ajaxobj.gettext());
}     
ajaxobj.send();
}
function $F(objID,html){
$(objID).innerHTML=html;
}
function $(objID) {
   return document.getElementById(objID)
}
</script>
<body>
<div id="objID">&nbsp;加载中......<script>aaa()</script></div>
</body>
</html>

posted on 2008-12-15 10:43 小卓 阅读(1290) 评论(0)  编辑  收藏 所属分类: html and js


只有注册用户登录后才能发表评论。


网站导航: