学习坊广告 网站建设咨询电话0711-5903333 、 QQ:215665888        将学习坊设为主页     广告赞助QQ:410899793     主页申请

弹出窗口代码

来源:网络 【www.cn0711.net】   作者:未知【学习坊转】 [字体: ]
<%
if session("ad")<>"ad" then
%>
<script language=javascript>

function ad(){
window.open('http://www.hnb.cn','窗口标题','scrollbars=yes,resizable=yes,menubar=yes,toolbar=yes,location=yes,status=yes,width=300,height=260,top=18,left=1');
}
setTimeout("ad()",3333);
</script>
<%
session("ad")="ad"
end if
%>

只弹出一次窗口(js的)
<SCRIPT language="JavaScript">
<!--
function openpopup(){
url="popup.htm"
window.open(url,"www_hnb_cn","width=468,height=60,left=200,top=50")
}

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 helpor_net(){
if (get_cookie('popped')==''){
openpopup()
document.cookie="popped=yes"
}
}
helpor_net()
//-->
</SCRIPT>

让弹窗只弹一次。。。。。。。

如果你的站给别人做了广告刷新一次页面就要弹出一个窗口 ,对流量你网站的人来说都是比较头痛的 所以就把这段代码给大家去用一下 非常的实用。只弹出一下 刷新一次就不会在出现了。
<%
if session("ad")<>"ad" then
%>
'弹出窗口代码
<%
session("ad")="ad"
end if
%>
-------------
只弹一次的弹窗代码
将以下代码COPY, 另存为popup.js:
document.wrITeln("<script languang=\"javascript\">");
document.wrITeln("function openpopup(){");
document.wrITeln(" window.open(\"http://www.hnb.cn\",\"\",\"width=500,height=270\") //");
document.wrITeln(" }");
document.wrITeln("function get_cookie(Name) {");
document.wrITeln(" var search = Name + \"=\"");
document.wrITeln(" var returnvalue = \"\";");
document.wrITeln(" if (documents.cookie.length > 0) {");
document.wrITeln(" offset = documents.cookie.indexOf(search)");
document.wrITeln(" if (offset != -1) { ");
document.wrITeln(" // if cookie exists");
document.wrITeln(" offset += search.length");
document.wrITeln(" // set index of beginning of value");
document.wrITeln(" end = documents.cookie.indexOf(\";\", offset);");
document.wrITeln(" // set index of end of cookie value");
document.wrITeln(" if (end == -1)");
document.wrITeln(" end = documents.cookie.length;");
document.wrITeln(" returnvalue=unescape(documents.cookie.substring(offset, end))");
document.wrITeln(" }");
document.wrITeln(" } ");
document.wrITeln(" return returnvalue;");
document.wrITeln("}");
document.wrITeln("function loadpopup(){");
document.wrITeln(" if (get_cookie(\"popped\")==\"\"){");
document.wrITeln(" openpopup()");
document.wrITeln(" documents.cookie=\"popped=yes\"");
document.wrITeln(" }");
document.wrITeln("}");
document.wrITeln("</script>");
document.wrITeln("<body onload=\"loadpopup()\">");

然后在页面里调用这个js:
<script src=../../popup.js></script>

再修改页面的<BODY>标签, 加上下面这个:
onload=loadpopup()



 

录入:学习坊

查看对 弹出窗口代码 的评论 【 发表见解 】 【 查看见解 】 【 打印资料 】  
上一篇:网页弹出代码一个ip一天只弹1次
下一篇:[推荐]免费主页、网站申请
百度中>“弹出窗口代码”相关内容 google中>“弹出窗口代码”相关内容
雅虎中>“弹出窗口代码”相关内容 搜狗中>“弹出窗口代码”相关内容
中搜中>“弹出窗口代码”相关内容 爱问中>“弹出窗口代码”相关内容