<script>
   function checkTitleNull(){
var biaoti=document.getElementById("biaoti").value;
biaoti=biaoti.replace(/\s/g,"")
if(biaoti==""){
alert("标题不能为空!");
return false;
}
}

   function checkNeiNull(){
var tieNei=document.getElementById("tieNei").value;
tieNei=tieNei.replace(/\s/g,"")
if(tieNei==""){
alert("内容不能为空!请认真填写!");
return false;
}
}

function checkAll(){ 
   if(checkTitleNull()==false||checkNeiNull()==false){
return false;
}else{
doAjax();
return true;
}
 }
var xmlHttp;
    function createXMLHttp(){
   
if(window.ActiveXObject)//验证游览器类型
{//ie
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
else
{//其他
xmlHttp=new XMLHttpRequest();
}
  }
 function doAjax(){
createxmlHttp();
  var biaoti=document.getElementById("biaoti").value;
var tieNei=document.getElementById("tieNei").value;
//初始化参数
    if(XMLHttp!=null){
    xmlHttp.open("post","LybServlet?biaoti="+biaoti+"&tieNei="+tieNei,true);
    XMLHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
//调用回调函数
xmlHttp.onReadyStateChange=collback;
  //发送数据
xmlHttp.send(null);
 }
}
function collback(){

//当为4和200的时候表示成功执行
if(xmlHttp.readystate==4 && xmlHttp.status==200)
{
var str=xmlHttp.responseText;
//接受服务器返回的数据
if(str!=shibai){
 //在这里我要显示内容。是一个table里面数据都是从数据库里读出来的,下面就是这些代码,所有的这些代码都写在一个jsp页面。 不是把下面的代码都放在这里吧?
}
}
}
  </script><%
CheckUserBiz check=new CheckUserBizImpl();
List<leaveWord> list=new ArrayList<leaveWord>();
leaveWord lw=new leaveWord();
String inPage= request.getParameter("inPage"); //输入的第几页,当前第几页
int pagesize=15; //每页显示15条数据
int count=check.leaveWordCount();   //总帖子数
int number=(count/pagesize==0)?(count/pagesize):(count/pagesize+1); //总页数

if(inPage==null){ //输入的页数为空或者没有得到正常数值时赋值"1"
inPage="1";
}
int pagIndex=commenFunction.stringtoint(inPage);
if(pagIndex<=0){ //输入的页数小于等于0页则返回第一页
pagIndex=1;
}
if(pagIndex>number){ //输入的页数大于总页数则返回第一页
pagIndex=1;
}
list=check.getlwList(pagesize,pagIndex); //得到已从数据库分页的数据
if(list!=null){
if(list.size()>0){
for(int i=0; i<list.size(); i++){
lw=list.get(i);
out.print("<tr class='tableCss2'>");
out.print("<td class='tdFont' width='25%' >");
out.print("<a name='ti' href='tzxq.jsp?tieId="+lw.getTieId()+"'>"+(i+1)+"&nbsp;&nbsp;&nbsp;"+lw.getTieTitle()+"</a></td>");
out.print("<td class='tdFont' width='25%' align='center'>"+lw.getFatiePeople()+"</td>");
out.print("<td class='tdFont' width='25%' align='center'>"+commenFunction.stringtodate(lw.getFatieTime())+"</td>");
out.print("</tr>");
  }
  }else{
out.print("<tr class='tableCss2'>");
out.print("<td colspan='3'>");
out.print("没有任何主题");
out.print("</td>");
out.print("</tr>");
}
}
%>