日期:2013-10-16  浏览次数:20761 次

获取页面的HTML

<script>
var oXmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
oXmlHttp.open("GET","http://www.163.com", false);
oXmlHttp.send()
var oStream = new ActiveXObject("ADODB.Stream");
if(oStream == null)
alert("您的机器不支持ADODB.Stream.")
else
{
oStream.Type=1;
oStream.Mode=3;
oStream.Open() ;
oStream.Write(oXmlHttp.responseBody);
oStream.Position= 0;
oStream.Type= 2;
oStream.Charset="gb2312";
var result= oStream.ReadText();
oStream.Close();
oStream = null;
var aa = window.open("","")
document.write(result);
aa.document.write(result);
}
</script>

[新开一个窗口]============================================================================================================
window.open('filename','','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=400,height=570,top=200,left=300,bottom=0,right=0');

[关于JS调用]============================================================================================================
new.asp(调用文件)
<%

str = "循环取的要调用的数据"
'关键是下面这句,调用document函数打印输入str值--->
%>
document.write('<%=str%>')
OK,结束,在其他要调用的页面插入
<script language="javascript" src="new文件所在目录/news.asp></script>

[打开一个窗口,并且关闭当前窗口]============================================================================================================
<script language="JavaScript">
//-->
window.open('MenuMain.asp','','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=,height=,top=0,left=0,bottom=0,right=0');
window.opener = "meizz"; //加了这句代码IE5.5+不会有关闭提示
window.close();
//--
</script>

[分页显示记录]============================================================================================================
一.
<%
dim MaxPerPage
dim totalPage
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
%>

二.
<%
set rs=server.createobject("adodb.recordset")
sql="select top 20 * from person order by id desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "没有任何人才信息"
else
rs.pagesize=10
MaxPerPage=rs.pagesize
totalPage=rs.pagecount
if CurrentPage<1 then
CurrentPage=1
end if
if CurrentPage>totalPage then
CurrentPage=totalPage
end if
if CurrentPage>1 then
rs.move (CurrentPage-1)*MaxPerPage
dim bookmark
bookmark rs.bookmark
end if
i=1
do while not rs.eof and i<=10
%>
......本页显示的数据
<%
i=i+1
rs.movenext
loop
end if
rs.close
%>

三.
<a href="allrencai.asp?page=1>第一页  </a>
<a href="allrencai.asp?page=<%=CurrentPage-1%>上一页  </a>
<a href="allrencai.asp?page=<%=CurrentPage+1%>">下一页  </a>
<a href="allrencai.asp?page=<%=totalPage%>最末页</a>
按照上面的模式套进去就可以了,应该没什么问题!

[获取用户IP]============================================================================================================
request.servervariables("remote_addr")

[对象的显示与隐藏(style.display的应用)]============================================================================================================
document.name.style.display="none"; //隐藏
document.name.style.display="block";