座機式鏈接生成器
做的一個方便老司機收藏資源站的腳本, 像撥打座機一樣,只要按下一組號碼便自動鏈接到其他網(wǎng)頁,可當做短鏈生成器,如01是AcFun.cn,02是bilibili.com,25是YouTube.com
步驟一??拷貝以下腳本后貼在有關(guān)網(wǎng)頁的<head>與</head>之間
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var dianhua_num='';
var timerID = null;
var timerRunning = false;
function but1()
{
?
dianhua_num = dianhua_num + '1';
?chknum();
}
function but2()
{
?dianhua_num = dianhua_num + '2';
?chknum();
}
function but3()
{
?dianhua_num = dianhua_num + '3';
?chknum();
}
function but4()
{
?dianhua_num = dianhua_num + '4';
?chknum();
}
function but5()
{
?dianhua_num = dianhua_num + '5';
?chknum();
}
function but6()
{
?dianhua_num = dianhua_num + '6';
?chknum();
}
function but7()
{
?dianhua_num = dianhua_num + '7';
?chknum();
}
function but8()
{
?dianhua_num = dianhua_num + '8';
?chknum();
}
function but9()
{
?dianhua_num = dianhua_num + '9';
?chknum();
}
function but0()
{
?dianhua_num = dianhua_num + '0';
?chknum();
}
function chknum()
{
//在這里設(shè)定號碼與路徑
if (dianhua_num=="01")
?document.location="http://www.lidicity.com";
if (dianhua_num=="768")
?document.location="http://www.lidicity.com/julebu/";
if (dianhua_num=="756")
?document.location="http://www.lidicity.com/julebu/zhiwangle/";
if (dianhua_num=="5997")
?document.location="http://www.lidicity.com/hjjq/";
if (dianhua_num=="963")
?document.location="http://www.lidicity.com/msgboard.mv";
document.board.pn.value=dianhua_num;
}
function clearit()
{
?dianhua_num = "";
?document.board.pn.value=dianhua_num;
}
//? End -->
</script>
步驟二??拷貝以下代碼加在<body>與</body>標記之間,要展示它的部位
<form name="board">
<center>
<table BORDER="2" BORDERCOLOR="#000000" CELLSPACING=2 CELLPADDING=3 COLS=3 WIDTH="130" BGCOLOR="#025B75" >
<tr ALIGN=CENTER>
<td><input type=button value="? 1? "onClick="but1(); window.focus()" style="background-color: rgb(217,245,252); color: rgb(2,91,117); border-left: 1px solid rgb(255,255,255); border-right: 1px solid rgb(0,0,0); border-top: 1px solid rgb(255,255,255); border-bottom: 1px solid rgb(0,0,0)"></td>
<td><input type=button value="? 2? "onClick="but2(); window.focus()" style="background-color: rgb(217,245,252); color: rgb(2,91,117); border-left: 1px solid rgb(255,255,255); border-right: 1px solid rgb(0,0,0); border-top: 1px solid rgb(255,255,255); border-bottom: 1px solid rgb(0,0,0)"></td>
<td><input type=button value="? 3? "onClick="but3(); window.focus()" style="background-color: rgb(217,245,252); color: rgb(2,91,117); border-left: 1px solid rgb(255,255,255); border-right: 1px solid rgb(0,0,0); border-top: 1px solid rgb(255,255,255); border-bottom: 1px solid rgb(0,0,0)"></td>
</tr>
<tr ALIGN=CENTER>
<td><input type=button value="? 4? "onClick="but4(); window.focus()" style="background-color: rgb(217,245,252); color: rgb(2,91,117); border-left: 1px solid rgb(255,255,255); border-right: 1px solid rgb(0,0,0); border-top: 1px solid rgb(255,255,255); border-bottom: 1px solid rgb(0,0,0)"></td>
<td><input type=button value="? 5? "onClick="but5(); window.focus()" style="background-color: rgb(217,245,252); color: rgb(2,91,117); border-left: 1px solid rgb(255,255,255); border-right: 1px solid rgb(0,0,0); border-top: 1px solid rgb(255,255,255); border-bottom: 1px solid rgb(0,0,0)"></td>
<td><input type=button value="? 6? "onClick="but6(); window.focus()" style="background-color: rgb(217,245,252); color: rgb(2,91,117); border-left: 1px solid rgb(255,255,255); border-right: 1px solid rgb(0,0,0); border-top: 1px solid rgb(255,255,255); border-bottom: 1px solid rgb(0,0,0)"></td>
</tr>
<tr ALIGN=CENTER>
<td><input type=button value="? 7? "onClick="but7(); window.focus()" style="background-color: rgb(217,245,252); color: rgb(2,91,117); border-left: 1px solid rgb(255,255,255); border-right: 1px solid rgb(0,0,0); border-top: 1px solid rgb(255,255,255); border-bottom: 1px solid rgb(0,0,0)"></td>
<td><input type=button value="? 8? "onClick="but8(); window.focus()" style="background-color: rgb(217,245,252); color: rgb(2,91,117); border-left: 1px solid rgb(255,255,255); border-right: 1px solid rgb(0,0,0); border-top: 1px solid rgb(255,255,255); border-bottom: 1px solid rgb(0,0,0)"></td>
<td><input type=button value="? 9? "onClick="but9(); window.focus()" style="background-color: rgb(217,245,252); color: rgb(2,91,117); border-left: 1px solid rgb(255,255,255); border-right: 1px solid rgb(0,0,0); border-top: 1px solid rgb(255,255,255); border-bottom: 1px solid rgb(0,0,0)"></td>
</tr>
<tr ALIGN=CENTER>
<td><input type=button value="? *? "onClick="clearit(); window.focus()" style="background-color: rgb(217,245,252); color: rgb(2,91,117); border-left: 1px solid rgb(255,255,255); border-right: 1px solid rgb(0,0,0); border-top: 1px solid rgb(255,255,255); border-bottom: 1px solid rgb(0,0,0)"></td>
<td><input type=button value="? 0? "onClick="but0(); window.focus()" style="background-color: rgb(217,245,252); color: rgb(2,91,117); border-left: 1px solid rgb(255,255,255); border-right: 1px solid rgb(0,0,0); border-top: 1px solid rgb(255,255,255); border-bottom: 1px solid rgb(0,0,0)"></td>
<td><input type=button value="? #? "onClick="clearit(); window.focus()" style="background-color: rgb(217,245,252); color: rgb(2,91,117); border-left: 1px solid rgb(255,255,255); border-right: 1px solid rgb(0,0,0); border-top: 1px solid rgb(255,255,255); border-bottom: 1px solid rgb(0,0,0)"></td>
</tr>
<tr>
<td ALIGN=CENTER COLSPAN="3"><input type=text name=pn size="10" style="background-color: rgb(192,216,184); color: rgb(0,0,0); border-left: 1px solid rgb(0,0,0); border-right: 1px solid rgb(255,255,255); border-top: 1px solid rgb(0,0,0); border-bottom: 1px solid rgb(255,255,255)"></td>
</tr>
</table></center>
<center></form>
</center>
注意:先設(shè)定好數(shù)字含義才能使用,可以用它實現(xiàn)快速搜索