1.在下面的輸入框內(nèi)輸入你的密碼(這就是你要求瀏覽者要輸入密碼后才能訪問(wèn)的密碼)密碼的長(zhǎng)度必須是少于十位,只允許字母與數(shù)目字.
<script>
var lengthe=''
var length2=''
var numletter="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
var key=0
var temp,temp2,t3=''
var userinput
function generate(input){
temp=numletter.indexOf(input)
var temp2=temp^key
temp2=numletter.substring(temp2,temp2+1)
return (temp2)
}
function generateit(inputs){
lengthe=''
length2=''
key=0
temp=temp2=t3=''
userinput=inputs
key=Math.round(Math.random()*63)
if (key<11)
key=key+11+Math.round(Math.random()*40)
length2=inputs.length
for (i=0;i
function JM_setPageName(){
var ob=MM_findObj('password2');obt=MM_findObj('pagename'); if (ob&&obt&&ob.value.length>0){
obt.innerText=ob.value
}
}
</script>
2.請(qǐng)把輸入正確密碼后進(jìn)入的頁(yè)面的文件名改為[密碼.html]
<script>
function proceed(){
if (document.password1.password2.value.length<10&&document.password1.password2.value.length>0){
generateit(document.password1.password2.value)
jp();
JM_cc('S1');
}
else
alert("密碼不能長(zhǎng)度不符合或者為空!")
}
</script>
<script>
function jp(){
var cutcontent=document.g.S1.value
document.g.S1.value=''
var p4=lengthe
var thepassword="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
var tempvar=new Array("","","","","","")
var cur=0
var ep='<script>\n\nvar pass=new Array()\n'
ep+='var t3=""\nvar lim='+p4+'\npass[0]="'
var keypiece=thepassword.charAt(Math.round(Math.random()*62))
var p1=t3
var p2=length2
var p3=key
function createpass(){
return (thepassword.charAt(Math.round(Math.random()*62)))
}
for (i=0;i<3;i++){
for (i2=0;i2<15;i2++)
tempvar[cur]+=createpass()
cur++
}
for (i2=0;i2<15-p2;i2++)
tempvar[cur]+=createpass()
cur++
for (i2=0;i2<14;i2++)
tempvar[cur]+=createpass()
cur++
ep+=tempvar[0]+'"\npass[1]="'+tempvar[1]+'"\npass[2]="'+tempvar[2]+'"\npass[3]="'+p1+tempvar[3]+'"\npass[4]="'+p2+tempvar[4]+keypiece+'"\npass[5]="'+p3+tempvar[4]+'"\n\n'
document.g.S1.value=ep+cutcontent
}
</script>
3.按下生成按鈕后同,內(nèi)容已經(jīng)復(fù)制到你的剪貼板了,你只需要把內(nèi)容粘貼到你的html文件內(nèi)就可以了.