1 2 3 下一页 假设有一个页面index.asp,上半部分为评论列表显示区域,下面为评论提交区域。那么这样一个页面我们如何显示评论内容和提交评论呢? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>评论系统</title> <script src="main.js"></script> <link href="main.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="pllist">正在加载评论…… <script> loadDom();setTimeout("loadDom()",10000);</script> </div> <div style="width:240px;font-size:12px;text-align:center"> <fieldset><legend>评论</legend> 呢称:<input name="user" type="text" style="width:180px"/><input name="newsid" value="1" type="hidden"/><br/> 内容:<textarea name="content" style="width:180px;height:80px"></textarea><br/> <input name="submit" value="我要评论" onclick="fb();" type="button" /> </fieldset> </div> <div style="font-size:12px;" id="msg"></div> </body> </html>
function getXHR() { try { xhr=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xhr=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { xhr=false; } } if(!xhr&&typeof XMLHttpRequest!=''undefined'') { xhr=new XMLHttpRequest(); } return xhr; } function openXHR(method,url,callback) { getXHR(); xhr.open(method,url); xhr.onreadystatechange=function() { if(xhr.readyState!=4)return; callback(xhr); } xhr.send(null); } function loadXML(method,url,callback) { getXHR(); xhr.open(method,url); xhr.setRequestHeader("Content-Type","text/xml"); xhr.setRequestHeader("Content-Type","GBK"); xhr.onreadystatechange=function() { if(xhr.readyState!=4) return; callback(xhr); } xhr.send(null); }
(责任编辑:admin) |