用ASP做网页时, 如何设置超链接打开新窗口?
是这样的,ASP中我允许用户后添加超链接,但是这些超链接打开的时候总是在同一个页面,我想让它在新窗口中打开...
是这样的,ASP中我允许用户后添加超链接,但是这些超链接打开的时候总是在同一个页面,我想让它在新窗口中打开
展开
4个回答
展开全部
//本窗口(弹出窗口)关闭,刷新父窗口
<script>window.opener.parent.location.reload();window.close()</script>
//后退一页
<a href="javascript:history.go(-1);">返回前页</a>
//新弹出窗口
<script language=JavaScript>
function newin(url,name,size)
{
var windowname=window.open(url,name,"left=0,top=0,status=no,scrollbars=no,resizable=no,"+size);
}
</script>
<a href=Javascript:newin('x.htm','Review','width=500,height=400')>查看简介</a>
//页面自动返回
<meta http-equiv="refresh" content="1;url=bigclass.asp">
<p align=center><font color=red>恭喜您!您选择的大类已经被删除!<br>1秒钟后返回上页!</font>
//关闭窗口
<a href="javascript:window.close();">点击这里关闭本窗口</a>
//载入时弹出窗口
<script language="JavaScript">
window.open('http://www.leshanju.6to23.com/','','toolbar,menubar,scrollbars,resizable,status,location,directories,copyhistory
,height=400,width=750');
</script>
//弹出窗口自动关闭
<script language="JavaScript">
function close() {
setTimeout("self.close()",10000) //毫秒
}
</script>
<body onload="close()">
//只弹出一次的窗口
<script>
function openwin(){
window.open("page.html","","width=200,height=200")
}
function get_cookie(Name) {
var search = Name + "=" var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}
function loadpopup(){
if (get_cookie("popped")=="){
openwin()
document.cookie="popped=yes"
}
}
</script>
<body onload="loadpopup()">
//控制新开窗口属性
<input type="button" Value="打开新窗口"
ONCLICK="window.open('test.htm', 'Sample',
'toolbar=yes,location=yes,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width=300,height=20
0,left=100,top=100')">
//web窗体对话框
<script language=javascript>
function logonApprove()
{
var
result=window.showModalDialog("ubbfaces.asp",window,"scroll:no;resizable:no;help:no;status:no;dialogWidth:400px;dialogHeight:
250px");
}
</script>
<script>window.opener.parent.location.reload();window.close()</script>
//后退一页
<a href="javascript:history.go(-1);">返回前页</a>
//新弹出窗口
<script language=JavaScript>
function newin(url,name,size)
{
var windowname=window.open(url,name,"left=0,top=0,status=no,scrollbars=no,resizable=no,"+size);
}
</script>
<a href=Javascript:newin('x.htm','Review','width=500,height=400')>查看简介</a>
//页面自动返回
<meta http-equiv="refresh" content="1;url=bigclass.asp">
<p align=center><font color=red>恭喜您!您选择的大类已经被删除!<br>1秒钟后返回上页!</font>
//关闭窗口
<a href="javascript:window.close();">点击这里关闭本窗口</a>
//载入时弹出窗口
<script language="JavaScript">
window.open('http://www.leshanju.6to23.com/','','toolbar,menubar,scrollbars,resizable,status,location,directories,copyhistory
,height=400,width=750');
</script>
//弹出窗口自动关闭
<script language="JavaScript">
function close() {
setTimeout("self.close()",10000) //毫秒
}
</script>
<body onload="close()">
//只弹出一次的窗口
<script>
function openwin(){
window.open("page.html","","width=200,height=200")
}
function get_cookie(Name) {
var search = Name + "=" var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}
function loadpopup(){
if (get_cookie("popped")=="){
openwin()
document.cookie="popped=yes"
}
}
</script>
<body onload="loadpopup()">
//控制新开窗口属性
<input type="button" Value="打开新窗口"
ONCLICK="window.open('test.htm', 'Sample',
'toolbar=yes,location=yes,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width=300,height=20
0,left=100,top=100')">
//web窗体对话框
<script language=javascript>
function logonApprove()
{
var
result=window.showModalDialog("ubbfaces.asp",window,"scroll:no;resizable:no;help:no;status:no;dialogWidth:400px;dialogHeight:
250px");
}
</script>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<a href="http://www.163.com" target="_blank">163</a>
target="_blank"就指明了在新窗口中打开,这和ASP没关系,这是HTML可以办到的,当然用JS的window.open也可以.
target="_blank"就指明了在新窗口中打开,这和ASP没关系,这是HTML可以办到的,当然用JS的window.open也可以.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<a target="_blank" href="aaa">aaa</a>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询