asp循环弹出不同网页的源代码 高手进,答案符合要求的给50分
asp循环弹出不同网页的源代码,要求是:1.显示的不同网页是在主页被选中的网页;2.弹出网页时间是要可以控制的,如隔10秒弹出一个网页,再隔十秒弹出另外一个网页;3.答案...
asp循环弹出不同网页的源代码,
要求是:
1.显示的不同网页是在主页被选中的网页;
2.弹出网页时间是要可以控制的,如隔10秒弹出一个网页,再隔十秒弹出另外一个网页;
3.答案所提交的源代码要直接能用;
4.如果你想CTRL+C和CTRL+V,放一些无用的东西,请不要回答;
5.这里的答案要求是纯asp做的。
以下是我做的源码
index.asp
<html>
<head>
<title>index.asp</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript" type="text/JavaScript">
<!--
function openwin(url)
{
window.open (url, "newwindow", "height=700, width=900, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no")
}
function openwin1()
{
window.open ("a.html", "newwindow", "height=700, width=900, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no")
}
-->
</script>
</head>
<body>
<form action="test2.asp" >
<table width="100%" height="50%" border="1">
<tr><td width="10%"><input type="checkbox" value="a.html" name="chk"></td><td width="*%">主页a</td></tr>
<tr><td width="10%"><input type="checkbox" value="b.html" name="chk"></td><td width="*%">主页b</td></tr>
<tr><td width="10%"><input type="checkbox" value="c.html" name="chk"></td><td width="*%">主页c</td></tr>
<tr>
<td align="center" colspan="2">
<%ss="a.html"%>
<input type="submit" value="打开窗口">
<input type="button" value="测试窗口" onClick="openwin('<%=ss%>')">
</td>
</tr>
</table>
</form>
</body>
</html>
test2.asp
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<%
function charCount(strS,chrC)
dim Tempstr
TempStr = Replace(strS, chrC, "")
charCount = Len(strS) - Len(TempStr)
end function
%>
<%
chk=request("chk")
chrC=","
xx=charCount(chk,chrC)
response.Write chk &"包含" &chrC& xx& "次"
'建立一个数组存储值
'xx=charCount(chk,chrC)
dim cardnoarray()
id=chk
for i=0 to xx
Redim Preserve cardnoarray(i)
if i<>xx then
cardnoarray(i)=left(id,Instr(id,",")-1)
'往数组里存值
else
cardnoarray(i)=id
end if
id=right(chk,len(id)-Instr(id,","))
next
'读取数组里的内容
for i=0 to xx
response.write "第"&i&"个:"&cardnoarray(i)
response.Write "<br>"
next
%>
</body>
<script language="javascript">
window.setInterval("pop(<%=cardnoarray(0)%>)",10000)
function pop(xx){
window.open("xx","","height=700,width=900,toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no");
}
</script>
</html>
a.html
<html>
<head>
<title>大屏幕显示首页</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript" type="text/JavaScript">
<!--
function closeit() {
setTimeout("self.close()",5000) //毫秒
}
-->
</script>
</head>
<body onLoad="closeit()">
显示5秒后关闭!
</body>
</html>
b.html c.html与a.html内容随便写。 展开
要求是:
1.显示的不同网页是在主页被选中的网页;
2.弹出网页时间是要可以控制的,如隔10秒弹出一个网页,再隔十秒弹出另外一个网页;
3.答案所提交的源代码要直接能用;
4.如果你想CTRL+C和CTRL+V,放一些无用的东西,请不要回答;
5.这里的答案要求是纯asp做的。
以下是我做的源码
index.asp
<html>
<head>
<title>index.asp</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript" type="text/JavaScript">
<!--
function openwin(url)
{
window.open (url, "newwindow", "height=700, width=900, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no")
}
function openwin1()
{
window.open ("a.html", "newwindow", "height=700, width=900, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no")
}
-->
</script>
</head>
<body>
<form action="test2.asp" >
<table width="100%" height="50%" border="1">
<tr><td width="10%"><input type="checkbox" value="a.html" name="chk"></td><td width="*%">主页a</td></tr>
<tr><td width="10%"><input type="checkbox" value="b.html" name="chk"></td><td width="*%">主页b</td></tr>
<tr><td width="10%"><input type="checkbox" value="c.html" name="chk"></td><td width="*%">主页c</td></tr>
<tr>
<td align="center" colspan="2">
<%ss="a.html"%>
<input type="submit" value="打开窗口">
<input type="button" value="测试窗口" onClick="openwin('<%=ss%>')">
</td>
</tr>
</table>
</form>
</body>
</html>
test2.asp
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<%
function charCount(strS,chrC)
dim Tempstr
TempStr = Replace(strS, chrC, "")
charCount = Len(strS) - Len(TempStr)
end function
%>
<%
chk=request("chk")
chrC=","
xx=charCount(chk,chrC)
response.Write chk &"包含" &chrC& xx& "次"
'建立一个数组存储值
'xx=charCount(chk,chrC)
dim cardnoarray()
id=chk
for i=0 to xx
Redim Preserve cardnoarray(i)
if i<>xx then
cardnoarray(i)=left(id,Instr(id,",")-1)
'往数组里存值
else
cardnoarray(i)=id
end if
id=right(chk,len(id)-Instr(id,","))
next
'读取数组里的内容
for i=0 to xx
response.write "第"&i&"个:"&cardnoarray(i)
response.Write "<br>"
next
%>
</body>
<script language="javascript">
window.setInterval("pop(<%=cardnoarray(0)%>)",10000)
function pop(xx){
window.open("xx","","height=700,width=900,toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no");
}
</script>
</html>
a.html
<html>
<head>
<title>大屏幕显示首页</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript" type="text/JavaScript">
<!--
function closeit() {
setTimeout("self.close()",5000) //毫秒
}
-->
</script>
</head>
<body onLoad="closeit()">
显示5秒后关闭!
</body>
</html>
b.html c.html与a.html内容随便写。 展开
1个回答
展开全部
test2.asp
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<%
Dim chks,chk
chks = Request("chk")
chk = Split(chks,",")
for i = 0 to ubound(chk)
response.write "<span id="&i+1&">"&chk(i)&"</span>"
next
%>
<script language="javascript">
var settimeri=0;
document.write(settimerxx(5000));
function settimerxx(sec){
settimeri++;
var num;
num = settimeri%<%=ubound(chk)+1%>;
if(num=="0") num=<%=ubound(chk)+1%>;
var strfilename = document.getElementById(num).innerText;
pp(strfilename);
setTimeout("settimerxx("+sec+");",sec);
}
function pp(str){
window.open(str,"","height=700,width=900,toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no");
}
</script>
</body>
</html>
其他几个页面跟你的一样
不知道是否符合你的意思,如果不符合,你改下应该也比较简单
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<%
Dim chks,chk
chks = Request("chk")
chk = Split(chks,",")
for i = 0 to ubound(chk)
response.write "<span id="&i+1&">"&chk(i)&"</span>"
next
%>
<script language="javascript">
var settimeri=0;
document.write(settimerxx(5000));
function settimerxx(sec){
settimeri++;
var num;
num = settimeri%<%=ubound(chk)+1%>;
if(num=="0") num=<%=ubound(chk)+1%>;
var strfilename = document.getElementById(num).innerText;
pp(strfilename);
setTimeout("settimerxx("+sec+");",sec);
}
function pp(str){
window.open(str,"","height=700,width=900,toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no");
}
</script>
</body>
</html>
其他几个页面跟你的一样
不知道是否符合你的意思,如果不符合,你改下应该也比较简单
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询