📄 artshow.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" import="java.sql.*" errorPage="" %>
<html><head>
<script type="text/javascript">
var xmlHttp;
var id;
function createXMLHttpRequest(){
if(window.ActiveXObject){
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
else if(window.XMLHttpRequest){
xmlHttp=new XMLHttpRequest();
}
}
function validate(){
createXMLHttpRequest();
var url="ArtShow1.jsp";
xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=callback;
xmlHttp.send(null);
}
function callback(){
if(xmlHttp.readyState==4){
show();
}
}
function show(){
var xmlDoc=xmlHttp.responseXML;
//alert(xmlHttp.responseText);
//alert(xmlHttp.responseXML.xml);
var yan=xmlDoc.getElementsByTagName("content");
var ta="<table border=0 width=78% align=center id=ta><tr><td>文章作者</td><td>文章标题</td><td>文章类别</td><td>发表时间</td></tr>";
for(var i=0;i<yan.length;i++){
var y=yan[i];
ta+="<tr><td colspan=5><hr size='1' noshade='noshade' color='#000000' style='border-bottom-style:dotted' width=820><td width=15%></td></tr>";
ta+="<tr id='aa'><td>"+y.childNodes[0].firstChild.data+"</td>";
ta+="<td width=30%>" + y.childNodes[1].firstChild.data + "</td>";
ta+="<td>" + y.childNodes[2].firstChild.data + "</td>";
ta+="<td>" + y.childNodes[3].firstChild.data + "</td>";
ta+="<td><a href='ArtShow2.jsp?artid="+y.childNodes[4].firstChild.data+"'>阅读</a></td></tr>";
}
ta+="</table>";
document.getElementById("res").innerHTML=ta;
//alert(yan.length);
}
</script></head>
<body onLoad="validate()">
<h3 align=center>文章浏览页面</h3>
<div id="res"></div>
</body>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -