包含一段代码实现随机访问页面的词条
admin 发布:2022-12-19 17:36 120
本篇文章给大家谈谈一段代码实现随机访问页面,以及对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。
本文目录一览:
如何使html随机跳转到某个网页?怎么写代码,详细说一下
说说原理:
那首先你要告诉程序,你有哪一些网页给它跳转,可以把这些做成数组,
通过jquery或者是js来生成随机数,做一个跳转动作,跳转到的页面就用随机出来的数字跟数组对应就可以随机跳转了。
求一个html代码。。随机跳转到网页
html
head
titleblog/title
SCRIPT LANGUAGE="JavaScript"
function a(){
setTimeout("b()",1000);//点击按钮一秒钟后跳转到随机页面
}
function b(){//跳转函数
var randompath=parseInt(Math.random()*3)+1;//随机得到1到3的整数(1,2,3)
window.location=randompath+".html";
}
/SCRIPT
/head
body
input onclick="a()" type="button" value="随机跳转"
/body
/html
在body的onload事件中调用a()即可
随机弹出网页代码怎么写?
SCRIPT language=javascript
window.showModelessDialog("","CHINAZindexP","center:no;dialogLeft:5px;dialogTop:5px;scroll:0;status:0;help:0;resizable:0;dialogWidth:1000px;dialogHeight:1000px")
/SCRIPT
dialogWidth:900px;dialogHeight:625px"分别是对话框的宽度和高度,据说一般这个弹出可是什么都挡不住的。
强制弹出网页代码,就算myie之类的浏览器也无效
script language="javascript" !-- var dc=document; dc.write('scr'+'ipt language="javascript" '); dc.write('window.showModelessDialog("'); dc.write('script/hit.asp?group_id=2330ad_id=2176","dialogwin","scroll:1;status:0;help:0;resizable:1;dialogWidth:800px;dialogHeight:600px"/images/wink.gif/scr'+'ipt'); -- /script
强制弹出窗口代码(xp sp2无法拦截)
Script Language="JavaScript"
var paypopupURL = "";
var usingActiveX = true;
function blockError(){return true;}
window.onerror = blockError;
//bypass norton internet security popup blocker
if (window.SymRealWinOpen){window.open = SymRealWinOpen;}
if (window.NS_ActualOpen) {window.open = NS_ActualOpen;}
if (typeof(usingClick) == 'undefined') {var usingClick = false;}
if (typeof(usingActiveX) == 'undefined') {var usingActiveX = false;}
if (typeof(popwin) == 'undefined') {var popwin = null;}
if (typeof(poped) == 'undefined') {var poped = false;}
if (typeof(paypopupURL) == 'undefined') {var paypopupURL = "";}
var blk = 1;
var setupClickSuccess = false;
var googleInUse = false;
var myurl = location.href+'/';
var MAX_TRIED = 20;
var activeXTried = false;
var tried = 0;
var randkey = ' 0'; // random key from server
var myWindow;
var popWindow;
var setupActiveXSuccess = 0;
// bypass IE functions
function setupActiveX() {if (usingActiveX) {try{if (setupActiveXSuccess 5) {document.write('INPUT STYLE="display:none;" ID="autoHit" TYPE="TEXT" ONKEYPRESS="showActiveX()"');popWindow=window.createPopup();popWindow.document.body.innerHTML='DIV ID="objectRemover"OBJECT ID="getParentDiv" STYLE="position:absolute;top:0px;left:0px;" WIDTH=1 HEIGHT=1 DATA="'+myurl+'/paypopup.html" TYPE="text/html"/OBJECT/DIV';document.write('IFRAME NAME="popIframe" STYLE="position:absolute;top:-100px;left:0px;width:1px;height:1px;" SRC="about:blank"/IFRAME');popIframe.document.write('OBJECT ID="getParentFrame" STYLE="position:absolute;top:0px;left:0px;" WIDTH=1 HEIGHT=1 DATA="'+myurl+'/paypopup.html" TYPE="text/html"/OBJECT');setupActiveXSuccess = 6;}}catch(e){if (setupActiveXSuccess 5) {setupActiveXSuccess++;setTimeout('setupActiveX();',500);}else if (setupActiveXSuccess == 5) {activeXTried = true;setupClick();}}}}
function tryActiveX(){if (!activeXTried !poped) {if (setupActiveXSuccess == 6 googleInUse popWindow popWindow.document.getElementById('getParentDiv') popWindow.document.getElementById('getParentDiv').object popWindow.document.getElementById('getParentDiv').object.parentWindow) {myWindow=popWindow.document.getElementById('getParentDiv').object.parentWindow;}else if (setupActiveXSuccess == 6 !googleInUse popIframe popIframe.getParentFrame popIframe.getParentFrame.object popIframe.getParentFrame.object.parentWindow){myWindow=popIframe.getParentFrame.object.parentWindow;popIframe.location.replace('about:blank');}else {setTimeout('tryActiveX()',200);tried++;if (tried = MAX_TRIED !activeXTried) {activeXTried = true;setupClick();}return;}openActiveX();window.windowFired=true;self.focus();}}
function openActiveX(){if (!activeXTried !poped) {if (myWindow window.windowFired){window.windowFired=false;document.getElementById('autoHit').fireEvent("onkeypress",(document.createEventObject().keyCode=escape(randkey).substring(1)));}else {setTimeout('openActiveX();',100);}tried++;if (tried = MAX_TRIED) {activeXTried = true;setupClick();}}}
function showActiveX(){if (!activeXTried !poped) {if (googleInUse) {window.daChildObject=popWindow.document.getElementById('objectRemover').children(0);window.daChildObject=popWindow.document.getElementById('objectRemover').removeChild(window.daChildObject);}newWindow=myWindow.open(paypopupURL,'abcdefg');if (newWindow) {newWindow.blur();self.focus();activeXTried = true;poped = true;}else {if (!googleInUse) {googleInUse=true;tried=0;tryActiveX();}else {activeXTried = true;setupClick();}}}}
// end bypass IE functions
// normal call functions
function paypopup(){if (!poped) {if(!usingClick !usingActiveX) {popwin = window.open(paypopupURL,'abcdefg');if (popwin) {poped = true;}self.focus();}}if (!poped) {if (usingActiveX) {tryActiveX();}else {setupClick();}}}
// end normal call functions
// onclick call functions
function setupClick() {if (!poped !setupClickSuccess){if (window.Event) document.captureEvents(Event.CLICK);prePaypopOnclick = document.onclick;document.onclick = gopop;self.focus();setupClickSuccess=true;}}
function gopop() {if (!poped) {popwin = window.open(paypopupURL,'abcdefg');if (popwin) {poped = true;}self.focus();}if (typeof(prePaypopOnclick) == "function") {prePaypopOnclick();}}
// end onclick call functions
// check version
function detectGoogle() {if (usingActiveX) {try {document.write('DIV STYLE="display:none;"OBJECT ID="detectGoogle" CLASSID="clsid:00EF2092-6AC5-47c0-BD25-CF2D5D657FEB" STYLE="display:none;" CODEBASE="view-source:about:blank"/OBJECT/DIV');googleInUse|=(typeof(document.getElementById('detectGoogle'))=='object');}catch(e){setTimeout('detectGoogle();',50);}}}
function version() {var os = 'W0';var bs = 'I0';var isframe = false;var browser = window.navigator.userAgent;if (browser.indexOf('Win') != -1) {os = 'W1';}if (browser.indexOf("SV1") != -1) {bs = 'I2';}else if (browser.indexOf("Opera") != -1) {bs = "I0";}else if (browser.indexOf("Firefox") != -1) {bs = "I0";}else if (browser.indexOf("Microsoft") != -1 || browser.indexOf("MSIE") != -1) {bs = 'I1';}if (top.location != this.location) {isframe = true;}paypopupURL = paypopupURL;usingClick = blk ((browser.indexOf("SV1") != -1) || (browser.indexOf("Opera") != -1) || (browser.indexOf("Firefox") != -1));usingActiveX = blk (browser.indexOf("SV1") != -1) !(browser.indexOf("Opera") != -1) ((browser.indexOf("Microsoft") != -1) || (browser.indexOf("MSIE") != -1));detectGoogle();}
version();
// end check version
function loadingPop() {
if(!usingClick !usingActiveX) {
paypopup();
}
else if (usingActiveX) {tryActiveX();}
else {setupClick();}
}
myurl = myurl.substring(0, myurl.indexOf('/',8));
if (myurl == '') {myurl = '.';}
setupActiveX();
loadingPop();
self.focus();
/Script
PHP写一个访问网页直接随机跳转我设置好的网页.带后台
只能告诉你怎么做,代码还是要你写。
1、先建一张链接表
字段大概就是name、url等
2、做好后台对链接表的增删改
3、跳转代码(简写)
//链接表的链接数
$count = select count(*) FROM links;
//随机到一个链接
$rand = mt_rand(1,$count);
$link = select * from links limit {$rand},1
//跳转
header('Location:'.$link);
关于一段代码实现随机访问页面和的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。
版权说明:如非注明,本站文章均为 AH站长 原创,转载请注明出处和附带本文链接;
相关推荐
- 05-18包含宁波seo推荐的词条
- 05-17包含bt磁力天堂torrentkitty的词条
- 05-16无限制访问国外的浏览器,能翻到国外的浏览器
- 05-14网站怎么设计,网站怎么设计怎么实现的
- 05-13包含不要手贱搜这15个关键词的词条
- 05-09网页代码,网页代码快捷键
- 05-07包含seo牛人的词条
- 05-06单页网站的代码(完整的网页代码)[20240506更新]
- 05-06个人主页图片代码(个人主页图片代码怎么弄)[20240506更新]
- 05-06提取微信名片代码(微信名片信息提取)[20240506更新]
取消回复欢迎 你 发表评论:
- 标签列表
- 最近发表
- 友情链接