各种打开新页面

来源:互联网 发布:开淘宝的保证金在哪退 编辑:程序博客网 时间:2024/05/18 09:34

//服务器端 在整个页面的打开新窗口
window.parent.parent.location.href = '../login.aspx';
//在另一个框架打开新页面
window.parent.mainFrame.location.href = 'NewsManage.aspx?type=0';

//几秒后自动跳转页面
<meta http-equiv="Refresh" content="5;URL=http://XXX" />

//frameset框架  利用target打开
window.open('test.htm', 'mainFrame');


1. window.location 法,代码如下

<body onload="window.location='http://xxxxx';"></body>

2. 框架法,代码如下

<frameset cols="100%,*">
<frame src="http://xxxxx" scrolling="auto">
</frameset>

其中scrolling参数值得注意,合理使用可加强隐蔽性。Cols参数可根据自己的实际情况作更改。

3. META标志法,代码如下

<META HTTP-EQUIV="Refresh" CONTENT="0;URL= http://xxxxx">

其中CONTENT后面的阿拉伯数字是代表过几秒中钟转入目标网页。

4. iframe内帧法

<iframe src="http://xxxxx" width="0" height="0" frameborder="0">
5.
在window.open()函数中增加一个参数,将target设置为‘self’,
即改为使用: window.open('link','_blank'); 等同window.location.href="link"
6.
<a   href= "# "   onclick= "window.showModalDialog( 'link') "> 点击 </a>
7.
function   replyMessage(id)
            {
                var   win = window.open('Reply.aspx?originMessage= '+id,'_blank');
                if   (win == null)
                    window.alert( "请不要启用弹出式窗口拦截 " );
            }
8.
window._open=window.open;
window.open=function(sURL,sName,sFeatures,bReplace){
if(sName==undefined){sName="_blank"};
if(sFeatures==undefined){sFeatures=""};
if(bReplace==undefined){bReplace=false};
var win=window._open(sURL,sName,sFeatures,bReplace);
if(!win){
    alert('天啦!你的机器上竟然有软件拦截弹出窗口耶,好讨厌哦,人家不来了啦!快去掉嘛~~555~');
    return false;
}
return true;
}

原创粉丝点击