`
wangangie28
  • 浏览: 44788 次
  • 性别: Icon_minigender_1
  • 来自: 天津
社区版块
存档分类
最新评论

ajax访问后台,获得数据显示DIV,JS获得单元格位置

 
阅读更多

  index.jsp        正在加载...' //读取数据-------------------------------------------------- ------------- XmlHttp(); xmlHttp.open("GET", "getweb0info.jsp?category="+idx, true); xmlHttp.onreadystatechange = getinfo; xmlHttp.send(null); //读取数据-------------------------------------------------- ------------- document.getElementById(idx).onmouseout=closem; document.getElementById(idx).innerHTML=divstr; } } //回调函数 function getinfo() { //alert(xmlHttp.responseText.Trim()) //alert(xmlHttp.readyState) var tmptext=""; if (xmlHttp.readyState == 4) { tmptext=xmlHttp.responseText.Trim(); if(tmptext==""){ tmptext="  获取数据错误!" } } else { tmptext="  获取数据错误!" } //alert(tmptext) document.getElementById("show"+categorycode).inner HTML=tmptext; } // -->  getweb0info.jsp              '1' AND ltinfo.otherprimory'3' "+ "AND groupuserrel.groupCode=groupsubjectactrel.GROUP_ID " + "AND (groupuserrel.userId=? OR groupuserrel.userId='guest') "+ "AND groupsubjectactrel.CODE LIKE '"+category+"%' "+ "and ltinfo.APP_ID='"+appID+"' "+ "ORDER BY createtime DESC LIMIT 5 "; Vector c_tmpV = new Vector(); Connection c_conn=c_dbPool.getConnection(); if(c_conn==null) { System.out.println(c_dbclass.getMsg()); return; } try{ //System.out.println(c_sql); c_tmpV = c_dbclass.doQuery(c_conn,c_sql,null,new String[]{userID}); //c_tmpV=c_dbclass.doQuery(c_conn,c_sql); }catch(Exception e) {}finally{ if(c_conn!=null) { try{ c_conn.close(); }catch(Exception e){} } } if(c_tmpV == null){ System.out.println(c_dbclass.getMsg()); } SimpleDateFormat sDateFormat=new SimpleDateFormat("yyyy-MM-dd"); String today = sDateFormat.format(new Date());//今天 java.util.Date pre_date = new java.util.Date(System.currentTimeMillis()- 1*24*3600*1000); String pre_time = sDateFormat.format(pre_date);//昨天 for(int i=0;i"; c_new[c]="new"; }else if(createtime.equals(pre_time)) { image=""; c_new[c]="new"; } String miid = pub.trimNull((String)tmpH.get("id")); String categorycode = pub.trimNull((String)tmpH.get("category")); String titleall=title; title=title.length()>15?title.substring(0,13)+"..." :title; %>      &category=" title=''>    []           暂时没有数据!      
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics