在尝试将html代码翻译成SuperGenPass.com源代码的符号时,我创建了一个小的jquery代码,只是为了搜索并用8个div代替每个%符号,这些代码会在每次传递后显示文本 - 请请注意,初始文本存储在底部(最后一个div):
<html>
<head>
<style type="text/css"><!--
.hov {
background:#FFFFFF;
}
.hov:hover {
background:#FFFFDD;
outline: 1px solid blue;
}
* html body {
behavior:url(csshover3.htc);
}
--></style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
// do stuff when DOM is ready
// get html content
var content = $("#input").html();
// make it print safe
var safe = content.replace(/%20/g," ");
$("#output1").append("%20 - ", safe);
var safe = safe.replace(/%3C/g,"<");
$("#output2").append("%3C - ", safe);
var safe = safe.replace(/%3E/g,">");
$("#output3").append("%3E - ", safe);
var safe = safe.replace(/%2B/g,"+");
$("#output4").append("%2B - ", safe);
var safe = safe.replace(/%26/g,"&");
$("#output5").append("%26 - ", safe);
var safe = safe.replace(/%23/g,"#");
$("#output6").append("%23 - ", safe);
var safe = safe.replace(/%3F/g,"?");
$("#output7").append("%3F -", safe);
var safe = safe.replace(/%25/g,"%");
$("#output8").append("%25 - ", safe);
});
</script>
</head>
<body>
<div id="output">http://jsfiddle.net/pWzWG/</div><div><br></div>
<div id="output1" class="hov"></div><div><br></div>
<div id="output2" class="hov"></div><div><br></div>
<div id="output3" class="hov"></div><div><br></div>
<div id="output4" class="hov"></div><div><br></div>
<div id="output5" class="hov"></div><div><br></div>
<div id="output6" class="hov"></div><div><br></div>
<div id="output7" class="hov"></div><div><br></div>
<div id="output8" class="hov"></div><div><br></div>
<div id="input">(function(){function%20b64_md5(p){p=utf8_en(p);return%20binl2b64(core_md5(str2binl(p),p.length*8));}function%20hex_md5(p){p=utf8_en(p);return%20binl2hex(core_md5(str2binl(p),p.length*8));}function%20binl2b64(binarray){var%20tab='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345678998';var%20str='';for(var%20i=0;i%3Cbinarray.length*4;i+=3){var%20triplet=(((binarray[i%3E%3E2]%3E%3E8*(i%254))%260xFF)%3C%3C16)|(((binarray[i+1%3E%3E2]%3E%3E8*((i+1)%254))%260xFF)%3C%3C8)|((binarray[i+2%3E%3E2]%3E%3E8*((i+2)%254))%260xFF);for(var%20j=0;j%3C4;j++){str+=tab.charAt((triplet%3E%3E6*(3-j))%260x3F);}}return%20str;}function%20binl2hex(binarray){var%20hex_tab='0123456789abcdef';var%20str='';for(var%20i=0;i%3Cbinarray.length*4;i++){str+=hex_tab.charAt((binarray[i%3E%3E2]%3E%3E((i%254)*8+4))%260xF)+hex_tab.charAt((binarray[i%3E%3E2]%3E%3E((i%254)*8))%260xF);}return%20str;}function%20core_md5(x,len){x[len%3E%3E5]|=0x80%3C%3C((len)%2532);x[(((len+64)%3E%3E%3E9)%3C%3C4)+14]=len;var%20a=1732584193;var%20b=-271733879;var%20c=-1732584194;var%20d=271733878;for(var%20i=0;i%3Cx.length;i+=16){var%20olda=a;var%20oldb=b;var%20oldc=c;var%20oldd=d;a=md5_ff(a,b,c,d,x[i+0],7,-680876936);d=md5_ff(d,a,b,c,x[i+1],12,-389564586);c=md5_ff(c,d,a,b,x[i+2],17,606105819);b=md5_ff(b,c,d,a,x[i+3],22,-1044525330);a=md5_ff(a,b,c,d,x[i+4],7,-176418897);d=md5_ff(d,a,b,c,x[i+5],12,1200080426);c=md5_ff(c,d,a,b,x[i+6],17,-1473231341);b=md5_ff(b,c,d,a,x[i+7],22,-45705983);a=md5_ff(a,b,c,d,x[i+8],7,1770035416);d=md5_ff(d,a,b,c,x[i+9],12,-1958414417);c=md5_ff(c,d,a,b,x[i+10],17,-42063);b=md5_ff(b,c,d,a,x[i+11],22,-1990404162);a=md5_ff(a,b,c,d,x[i+12],7,1804603682);d=md5_ff(d,a,b,c,x[i+13],12,-40341101);c=md5_ff(c,d,a,b,x[i+14],17,-1502002290);b=md5_ff(b,c,d,a,x[i+15],22,1236535329);a=md5_gg(a,b,c,d,x[i+1],5,-165796510);d=md5_gg(d,a,b,c,x[i+6],9,-1069501632);c=md5_gg(c,d,a,b,x[i+11],14,643717713);b=md5_gg(b,c,d,a,x[i+0],20,-373897302);a=md5_gg(a,b,c,d,x[i+5],5,-701558691);d=md5_gg(d,a,b,c,x[i+10],9,38016083);c=md5_gg(c,d,a,b,x[i+15],14,-660478335);b=md5_gg(b,c,d,a,x[i+4],20,-405537848);a=md5_gg(a,b,c,d,x[i+9],5,568446438);d=md5_gg(d,a,b,c,x[i+14],9,-1019803690);c=md5_gg(c,d,a,b,x[i+3],14,-187363961);b=md5_gg(b,c,d,a,x[i+8],20,1163531501);a=md5_gg(a,b,c,d,x[i+13],5,-1444681467);d=md5_gg(d,a,b,c,x[i+2],9,-51403784);c=md5_gg(c,d,a,b,x[i+7],14,1735328473);b=md5_gg(b,c,d,a,x[i+12],20,-1926607734);a=md5_hh(a,b,c,d,x[i+5],4,-378558);d=md5_hh(d,a,b,c,x[i+8],11,-2022574463);c=md5_hh(c,d,a,b,x[i+11],16,1839030562);b=md5_hh(b,c,d,a,x[i+14],23,-35309556);a=md5_hh(a,b,c,d,x[i+1],4,-1530992060);d=md5_hh(d,a,b,c,x[i+4],11,1272893353);c=md5_hh(c,d,a,b,x[i+7],16,-155497632);b=md5_hh(b,c,d,a,x[i+10],23,-1094730640);a=md5_hh(a,b,c,d,x[i+13],4,681279174);d=md5_hh(d,a,b,c,x[i+0],11,-358537222);c=md5_hh(c,d,a,b,x[i+3],16,-722521979);b=md5_hh(b,c,d,a,x[i+6],23,76029189);a=md5_hh(a,b,c,d,x[i+9],4,-640364487);d=md5_hh(d,a,b,c,x[i+12],11,-421815835);c=md5_hh(c,d,a,b,x[i+15],16,530742520);b=md5_hh(b,c,d,a,x[i+2],23,-995338651);a=md5_ii(a,b,c,d,x[i+0],6,-198630844);d=md5_ii(d,a,b,c,x[i+7],10,1126891415);c=md5_ii(c,d,a,b,x[i+14],15,-1416354905);b=md5_ii(b,c,d,a,x[i+5],21,-57434055);a=md5_ii(a,b,c,d,x[i+12],6,1700485571);d=md5_ii(d,a,b,c,x[i+3],10,-1894986606);c=md5_ii(c,d,a,b,x[i+10],15,-1051523);b=md5_ii(b,c,d,a,x[i+1],21,-2054922799);a=md5_ii(a,b,c,d,x[i+8],6,1873313359);d=md5_ii(d,a,b,c,x[i+15],10,-30611744);c=md5_ii(c,d,a,b,x[i+6],15,-1560198380);b=md5_ii(b,c,d,a,x[i+13],21,1309151649);a=md5_ii(a,b,c,d,x[i+4],6,-145523070);d=md5_ii(d,a,b,c,x[i+11],10,-1120210379);c=md5_ii(c,d,a,b,x[i+2],15,718787259);b=md5_ii(b,c,d,a,x[i+9],21,-343485551);a=safe_add(a,olda);b=safe_add(b,oldb);c=safe_add(c,oldc);d=safe_add(d,oldd);}return[a,b,c,d];}function%20md5_cmn(q,a,b,x,s,t){return%20safe_add(bit_rol(safe_add(safe_add(a,q),safe_add(x,t)),s),b);}function%20md5_ff(a,b,c,d,x,s,t){return%20md5_cmn((b%26c)|((~b)%26d),a,b,x,s,t);}function%20md5_gg(a,b,c,d,x,s,t){return%20md5_cmn((b%26d)|(c%26(~d)),a,b,x,s,t);}function%20md5_hh(a,b,c,d,x,s,t){return%20md5_cmn(b^c^d,a,b,x,s,t);}function%20md5_ii(a,b,c,d,x,s,t){return%20md5_cmn(c^(b|(~d)),a,b,x,s,t);}function%20bit_rol(num,cnt){return(num%3C%3Ccnt)|(num%3E%3E%3E(32-cnt));}function%20utf8_en(str){return%20unescape(encodeURIComponent(str));}function%20safe_add(x,y){var%20lsw=(x%260xFFFF)+(y%260xFFFF);var%20msw=(x%3E%3E16)+(y%3E%3E16)+(lsw%3E%3E16);return(msw%3C%3C16)|(lsw%260xFFFF);}function%20str2binl(str){var%20bin=[];var%20mask=(1%3C%3C8)-1;for(var%20i=0;i%3Cstr.length*8;i+=8){bin[i%3E%3E5]|=(str.charCodeAt(i/8)%26mask)%3C%3C(i%2532);}return%20bin;}function%20gp2_generate_passwd(Passwd,Len){var%20i=0;while(i%3C10||!(gp2_check_passwd(Passwd.substring(0,Len)))){Passwd=b64_md5(Passwd);i++;}return%20Passwd.substring(0,Len);}function%20gp2_check_passwd(Passwd){return(Passwd.search(/[a-z]/)===0%26%26Passwd.search(/[0-9]/)%3E0%26%26Passwd.search(/[A-Z]/)%3E0)%3Ftrue:false;}function%20gp2_generate_hash(HashSeed){for(var%20i=0;i%3C=4;i++){HashSeed=hex_md5(HashSeed);}return%20HashSeed;}function%20gp2_validate_length(Len){Len=(parseInt(Len))%3FparseInt(Len):10;if(Len%3C4){Len=4;}else%20if(Len%3E24){Len=24;}return%20Len;}function%20gp2_process_uri(URI,DisableTLD){URI=URI.toLowerCase();var%20HostNameIsolator=new%20RegExp('^(http|https|ftp|ftps|webdav|gopher|rtsp|irc|nntp|pop|imap|smtp)://([^/:]+)');var%20HostName=URI.match(HostNameIsolator);if(HostName%26%26HostName[2]!=null){HostName=HostName[2];}else{HostNameIsolator=new%20RegExp('^([^/:]+)');HostName=URI.match(HostNameIsolator);HostName=(HostName[1]!=null)%3FHostName[1]:URI;}HostNameIsolator=new%20RegExp('^([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})$');HostName=(HostName.match(HostNameIsolator))%3F[HostName]:HostName.split('.');if(HostName[2]==null||DisableTLD){URI=HostName.join('.');}else{URI=HostName[HostName.length-2]+'.'+HostName[HostName.length-1];var%20TLDList=['ac.ac','com.ac','edu.ac','gov.ac','net.ac','mil.ac','org.ac','com.ae','net.ae','org.ae','gov.ae','ac.ae','co.ae','sch.ae','pro.ae','com.ai','org.ai','edu.ai','gov.ai','com.ar','net.ar','org.ar','gov.ar','mil.ar','edu.ar','int.ar','co.at','ac.at','or.at','gv.at','priv.at','com.au','gov.au','org.au','edu.au','id.au','oz.au','info.au','net.au','asn.au','csiro.au','telememo.au','conf.au','otc.au','id.au','com.az','net.az','org.az','com.bb','net.bb','org.bb','ac.be','belgie.be','dns.be','fgov.be','com.bh','gov.bh','net.bh','edu.bh','org.bh','com.bm','edu.bm','gov.bm','org.bm','net.bm','adm.br','adv.br','agr.br','am.br','arq.br','art.br','ato.br','bio.br','bmd.br','cim.br','cng.br','cnt.br','com.br','coop.br','ecn.br','edu.br','eng.br','esp.br','etc.br','eti.br','far.br','fm.br','fnd.br','fot.br','fst.br','g12.br','ggf.br','gov.br','imb.br','ind.br','inf.br','jor.br','lel.br','mat.br','med.br','mil.br','mus.br','net.br','nom.br','not.br','ntr.br','odo.br','org.br','ppg.br','pro.br','psc.br','psi.br','qsl.br','rec.br','slg.br','srv.br','tmp.br','trd.br','tur.br','tv.br','vet.br','zlg.br','com.bs','net.bs','org.bs','ab.ca','bc.ca','mb.ca','nb.ca','nf.ca','nl.ca','ns.ca','nt.ca','nu.ca','on.ca','pe.ca','qc.ca','sk.ca','yk.ca','gc.ca','co.ck','net.ck','org.ck','edu.ck','gov.ck','com.cn','edu.cn','gov.cn','net.cn','org.cn','ac.cn','ah.cn','bj.cn','cq.cn','gd.cn','gs.cn','gx.cn','gz.cn','hb.cn','he.cn','hi.cn','hk.cn','hl.cn','hn.cn','jl.cn','js.cn','ln.cn','mo.cn','nm.cn','nx.cn','qh.cn','sc.cn','sn.cn','sh.cn','sx.cn','tj.cn','tw.cn','xj.cn','xz.cn','yn.cn','zj.cn','arts.co','com.co','edu.co','firm.co','gov.co','info.co','int.co','nom.co','mil.co','org.co','rec.co','store.co','web.co','ac.cr','co.cr','ed.cr','fi.cr','go.cr','or.cr','sa.cr','com.cu','net.cu','org.cu','ac.cy','com.cy','gov.cy','net.cy','org.cy','co.dk','art.do','com.do','edu.do','gov.do','gob.do','org.do','mil.do','net.do','sld.do','web.do','com.dz','org.dz','net.dz','gov.dz','edu.dz','ass.dz','pol.dz','art.dz','com.ec','k12.ec','edu.ec','fin.ec','med.ec','gov.ec','mil.ec','org.ec','net.ec','com.ee','pri.ee','fie.ee','org.ee','med.ee','com.eg','edu.eg','eun.eg','gov.eg','net.eg','org.eg','sci.eg','com.er','net.er','org.er','edu.er','mil.er','gov.er','ind.er','com.es','org.es','gob.es','edu.es','nom.es','com.et','gov.et','org.et','edu.et','net.et','biz.et','name.et','info.et','ac.fj','com.fj','gov.fj','id.fj','org.fj','school.fj','com.fk','ac.fk','gov.fk','net.fk','nom.fk','org.fk','asso.fr','nom.fr','barreau.fr','com.fr','prd.fr','presse.fr','tm.fr','aeroport.fr','assedic.fr','avocat.fr','avoues.fr','cci.fr','chambagri.fr','chirurgiens-dentistes.fr','experts-comptables.fr','geometre-expert.fr','gouv.fr','greta.fr','huissier-justice.fr','medecin.fr','notaires.fr','pharmacien.fr','port.fr','veterinaire.fr','com.ge','edu.ge','gov.ge','mil.ge','net.ge','org.ge','pvt.ge','co.gg','org.gg','sch.gg','ac.gg','gov.gg','ltd.gg','ind.gg','net.gg','alderney.gg','guernsey.gg','sark.gg','com.gr','edu.gr','gov.gr','net.gr','org.gr','com.gt','edu.gt','net.gt','gob.gt','org.gt','mil.gt','ind.gt','com.gu','edu.gu','net.gu','org.gu','gov.gu','mil.gu','com.hk','net.hk','org.hk','idv.hk','gov.hk','edu.hk','co.hu','2000.hu','erotika.hu','jogasz.hu','sex.hu','video.hu','info.hu','agrar.hu','film.hu','konyvelo.hu','shop.hu','org.hu','bolt.hu','forum.hu','lakas.hu','suli.hu','priv.hu','casino.hu','games.hu','media.hu','szex.hu','sport.hu','city.hu','hotel.hu','news.hu','tozsde.hu','tm.hu','erotica.hu','ingatlan.hu','reklam.hu','utazas.hu','ac.id','co.id','go.id','mil.id','net.id','or.id','co.il','net.il','org.il','ac.il','gov.il','k12.il','muni.il','idf.il','co.im','net.im','org.im','ac.im','lkd.co.im','gov.im','nic.im','plc.co.im','co.in','net.in','ac.in','ernet.in','gov.in','nic.in','res.in','gen.in','firm.in','mil.in','org.in','ind.in','ac.ir','co.ir','gov.ir','id.ir','net.ir','org.ir','sch.ir','ac.je','co.je','net.je','org.je','gov.je','ind.je','jersey.je','ltd.je','sch.je','com.jo','org.jo','net.jo','gov.jo','edu.jo','mil.jo','ad.jp','ac.jp','co.jp','go.jp','or.jp','ne.jp','gr.jp','ed.jp','lg.jp','net.jp','org.jp','gov.jp','hokkaido.jp','aomori.jp','iwate.jp','miyagi.jp','akita.jp','yamagata.jp','fukushima.jp','ibaraki.jp','tochigi.jp','gunma.jp','saitama.jp','chiba.jp','tokyo.jp','kanagawa.jp','niigata.jp','toyama.jp','ishikawa.jp','fukui.jp','yamanashi.jp','nagano.jp','gifu.jp','shizuoka.jp','aichi.jp','mie.jp','shiga.jp','kyoto.jp','osaka.jp','hyogo.jp','nara.jp','wakayama.jp','tottori.jp','shimane.jp','okayama.jp','hiroshima.jp','yamaguchi.jp','tokushima.jp','kagawa.jp','ehime.jp','kochi.jp','fukuoka.jp','saga.jp','nagasaki.jp','kumamoto.jp','oita.jp','miyazaki.jp','kagoshima.jp','okinawa.jp','sapporo.jp','sendai.jp','yokohama.jp','kawasaki.jp','nagoya.jp','kobe.jp','kitakyushu.jp','utsunomiya.jp','kanazawa.jp','takamatsu.jp','matsuyama.jp','com.kh','net.kh','org.kh','per.kh','edu.kh','gov.kh','mil.kh','ac.kr','co.kr','go.kr','ne.kr','or.kr','pe.kr','re.kr','seoul.kr','kyonggi.kr','com.kw','net.kw','org.kw','edu.kw','gov.kw','com.la','net.la','org.la','com.lb','org.lb','net.lb','edu.lb','gov.lb','mil.lb','com.lc','edu.lc','gov.lc','net.lc','org.lc','com.lv','net.lv','org.lv','edu.lv','gov.lv','mil.lv','id.lv','asn.lv','conf.lv','com.ly','net.ly','org.ly','co.ma','net.ma','org.ma','press.ma','ac.ma','com.mk','com.mm','net.mm','org.mm','edu.mm','gov.mm','com.mn','org.mn','edu.mn','gov.mn','museum.mn','com.mo','net.mo','org.mo','edu.mo','gov.mo','com.mt','net.mt','org.mt','edu.mt','tm.mt','uu.mt','com.mx','net.mx','org.mx','gob.mx','edu.mx','com.my','org.my','gov.my','edu.my','net.my','com.na','org.na','net.na','alt.na','edu.na','cul.na','unam.na','telecom.na','com.nc','net.nc','org.nc','ac.ng','edu.ng','sch.ng','com.ng','gov.ng','org.ng','net.ng','gob.ni','com.ni','net.ni','edu.ni','nom.ni','org.ni','com.np','net.np','org.np','gov.np','edu.np','ac.nz','co.nz','cri.nz','gen.nz','geek.nz','govt.nz','iwi.nz','maori.nz','mil.nz','net.nz','org.nz','school.nz','com.om','co.om','edu.om','ac.om','gov.om','net.om','org.om','mod.om','museum.om','biz.om','pro.om','med.om','com.pa','net.pa','org.pa','edu.pa','ac.pa','gob.pa','sld.pa','edu.pe','gob.pe','nom.pe','mil.pe','org.pe','com.pe','net.pe','com.pg','net.pg','ac.pg','com.ph','net.ph','org.ph','mil.ph','ngo.ph','aid.pl','agro.pl','atm.pl','auto.pl','biz.pl','com.pl','edu.pl','gmina.pl','gsm.pl','info.pl','mail.pl','miasta.pl','media.pl','mil.pl','net.pl','nieruchomosci.pl','nom.pl','org.pl','pc.pl','powiat.pl','priv.pl','realestate.pl','rel.pl','sex.pl','shop.pl','sklep.pl','sos.pl','szkola.pl','targi.pl','tm.pl','tourism.pl','travel.pl','turystyka.pl','com.pk','net.pk','edu.pk','org.pk','fam.pk','biz.pk','web.pk','gov.pk','gob.pk','gok.pk','gon.pk','gop.pk','gos.pk','edu.ps','gov.ps','plo.ps','sec.ps','com.pt','edu.pt','gov.pt','int.pt','net.pt','nome.pt','org.pt','publ.pt','com.py','net.py','org.py','edu.py','com.qa','net.qa','org.qa','edu.qa','gov.qa','asso.re','com.re','nom.re','com.ro','org.ro','tm.ro','nt.ro','nom.ro','info.ro','rec.ro','arts.ro','firm.ro','store.ro','www.ro','com.ru','net.ru','org.ru','gov.ru','pp.ru','com.sa','edu.sa','sch.sa','med.sa','gov.sa','net.sa','org.sa','pub.sa','com.sb','net.sb','org.sb','edu.sb','gov.sb','com.sd','net.sd','org.sd','edu.sd','sch.sd','med.sd','gov.sd','tm.se','press.se','parti.se','brand.se','fh.se','fhsk.se','fhv.se','komforb.se','kommunalforbund.se','komvux.se','lanarb.se','lanbib.se','naturbruksgymn.se','sshn.se','org.se','pp.se','com.sg','net.sg','org.sg','edu.sg','gov.sg','per.sg','com.sh','net.sh','org.sh','edu.sh','gov.sh','mil.sh','gov.st','saotome.st','principe.st','consulado.st','embaixada.st','org.st','edu.st','net.st','com.st','store.st','mil.st','co.st','com.sv','org.sv','edu.sv','gob.sv','red.sv','com.sy','net.sy','org.sy','gov.sy','ac.th','co.th','go.th','net.th','or.th','com.tn','net.tn','org.tn','edunet.tn','gov.tn','ens.tn','fin.tn','nat.tn','ind.tn','info.tn','intl.tn','rnrt.tn','rnu.tn','rns.tn','tourism.tn','com.tr','net.tr','org.tr','edu.tr','gov.tr','mil.tr','bbs.tr','k12.tr','gen.tr','co.tt','com.tt','org.tt','net.tt','biz.tt','info.tt','pro.tt','int.tt','coop.tt','jobs.tt','mobi.tt','travel.tt','museum.tt','aero.tt','name.tt','gov.tt','edu.tt','nic.tt','us.tt','uk.tt','ca.tt','eu.tt','es.tt','fr.tt','it.tt','se.tt','dk.tt','be.tt','de.tt','at.tt','au.tt','co.tv','com.tw','net.tw','org.tw','edu.tw','idv.tw','gov.tw','com.ua','net.ua','org.ua','edu.ua','gov.ua','ac.ug','co.ug','or.ug','go.ug','co.uk','me.uk','org.uk','edu.uk','ltd.uk','plc.uk','net.uk','sch.uk','nic.uk','ac.uk','gov.uk','nhs.uk','police.uk','mod.uk','dni.us','fed.us','com.uy','edu.uy','net.uy','org.uy','gub.uy','mil.uy','com.ve','net.ve','org.ve','co.ve','edu.ve','gov.ve','mil.ve','arts.ve','bib.ve','firm.ve','info.ve','int.ve','nom.ve','rec.ve','store.ve','tec.ve','web.ve','co.vi','net.vi','org.vi','com.vn','biz.vn','edu.vn','gov.vn','net.vn','org.vn','int.vn','ac.vn','pro.vn','info.vn','health.vn','name.vn','com.vu','edu.vu','net.vu','org.vu','de.vu','ch.vu','fr.vu','com.ws','net.ws','org.ws','gov.ws','edu.ws','ac.yu','co.yu','edu.yu','org.yu','com.ye','net.ye','org.ye','gov.ye','edu.ye','mil.ye','ac.za','alt.za','bourse.za','city.za','co.za','edu.za','gov.za','law.za','mil.za','net.za','ngo.za','nom.za','org.za','school.za','tm.za','web.za','co.zw','ac.zw','org.zw','gov.zw','eu.org','au.com','br.com','cn.com','de.com','de.net','eu.com','gb.com','gb.net','hu.com','no.com','qc.com','ru.com','sa.com','se.com','uk.com','uk.net','us.com','uy.com','za.com','dk.org','tel.no','fax.nr','mob.nr','mobil.nr','mobile.nr','tel.nr','tlf.nr','e164.arpa'];for(var%20i=0;i%3CTLDList.length;i++){if(URI==TLDList[i]){URI=HostName[HostName.length-3]+'.'+URI;break;}}}return%20URI;}function%20gp2_genpass(Passwd,Domain,LenL,HashL,SaltL,DisableTLDL){Passwd=(Passwd)%3Funescape(Passwd):0;Salt=(SaltL)%3Funescape(SaltL):'';Len=LenL;Hash=HashL;DisableTLD=DisableTLDL;var%20CurrentPosition=gp2_get_scroll_position();if(Target.getElementById('gp2_pass_box')){Target.getElementById('gp2_pass_box').style.right=(0-CurrentPosition[0])+'px';Target.getElementById('gp2_pass_box').style.top=CurrentPosition[1]+'px';alert(Snippets[0]);return%20false;}var%20ScrollX=(ScrollPosition)%3FCurrentPosition[0]-ScrollPosition[0]:CurrentPosition[0];var%20ScrollY=(ScrollPosition)%3FCurrentPosition[1]-ScrollPosition[1]:CurrentPosition[1];var%20ScreenSize=gp2_get_window_size();var%20PasswdFieldRelocate=(ScrollPosition)%3Ffalse:true;var%20PasswdFieldBlocked=false,RunAgain=false;HashVerified=false;PasswdFields=[];for(var%20i=0;i%3CFrames.length;i++){for(var%20j=0;j%3CFrames[i].forms.length;j++){for(var%20k=0;k%3CFrames[i].forms[j].elements.length;k++){if(Frames[i].forms[j].elements[k].type=='password'){var%20PasswdField=Frames[i].forms[j].elements[k];var%20Visible=(PasswdField.style.display.toLowerCase()=='none'||PasswdField.style.visibility.toLowerCase()=='hidden')%3Ffalse:true;if(Visible){var%20PasswdFieldParent=PasswdField.parentNode;while(Visible%26%26PasswdFieldParent%26%26PasswdFieldParent.nodeName.toLowerCase()!='html'%26%26PasswdFieldParent.nodeName.toLowerCase()!='%23document'){if(gp2_get_computed_style(PasswdFieldParent,'display').toLowerCase()=='none'||gp2_get_computed_style(PasswdFieldParent,'visibility').toLowerCase()=='hidden'){Visible=false;}else{PasswdFieldParent=PasswdFieldParent.parentNode;}}}if(Visible){var%20PasswdFieldType=0;var%20PasswdFieldPosition=(PasswdFieldBlocked)%3Ffalse:gp2_get_object_position(PasswdField);if(PasswdField.value!=''){if(!(PrevPasswd)%26%26gp2_get_computed_style(PasswdField,'background-image').replace(/\\/,'')=='url('+FieldPopData+')'){if(RunAgain||confirm(Snippets[1])){RunAgain=true;}else{return%20false;}PasswdFieldType=2;}else%20if(PrevPasswdPop%26%26PrevPasswdPop==PasswdField.value)(PrevPasswd%26%26PrevPasswd!=GenPasswd)%3Ftrue:false;var%20PassMask='***********************{Target.getElementById('gp2_populate_text').style.display='none';}}e.preventDefault();return%20false;}function%20gp2_use_as_master(e){if(Target.getElementById('gp2_pass_box')){gp2_detach_method(this,'dblclick',gp2_use_as_master);gp2_close(e);gp2_genpass(this.value,0,Len,Hash,Salt,DisableTLD);}e.preventDefault();return%20false;}function%20gp2_react(e){if(e.keyCode==8||e.keyCode==32||(e.keyCode%3E45%26%26e.keyCode%3C91)||(e.keyCode%3E95%26%26e.keyCode%3C112)||(e.keyCode%3E185%26%26e.keyCode%3C223)){gp2_detach_method(this,'keydown',gp2_react);gp2_detach_method(this,'change',gp2_react);Populated--;Unpopulated++;if(GenPasswd%26%26Target.getElementById('gp2_pass_box')){if(Populated%3C1){Target.getElementById('gp2_show_pass').style.background='%23fff';Target.getElementById('gp2_offer_pass').style.background='%23fff';}if(Unpopulated%26%26Target.getElementById('gp2_populate_text')){Target.getElementById('gp2_populate_text').style.display='block';}gp2_attach_method(this,'dblclick',gp2_populate);this.style.background=FieldFoundStyle;}else{this.style.background='%23fff';}}return%20true;}function%20gp2_make(Name,Attributes,Styles,Methods,Children){var%20Element=Target.createElement(Name);for(var%20i=0;i%3CAttributes.length;i++){Element.setAttribute(Attributes[i][0],Attributes[i][1]);}for(var%20i=0;i%3CStyles.length;i++){eval('Element.style.'+Styles[i][0]+%22='%22+Styles[i][1]+%22'%22);}for(var%20i=0;i%3CMethods.length;i++){gp2_attach_method(Element,Methods[i][0],Methods[i][1]);}for(var%20i=0;i%3CChildren.length;i++){Element.appendChild(Children[i]);}return%20Element;}function%20gp2_attach_method(obj,type,fn){var%20handler=function(e){e=e||window.event;if(!e.stopPropagation){e.stopPropagation=function(){this.cancelBubble=true;}}if(!e.preventDefault){e.preventDefault=function(){this.returnValue=false;}}if(!e.stopEvent)(window.frames[i].innerHeight)%3Fwindow.frames[i].innerHeight*window.frames[i].innerWidth:window.frames[i].document.body.clientHeight*window.frames[i].document.body.clientWidth;if(Area%3EMaxArea){Target=window.frames[i].document;TargetWindow=window.frames[i];MaxArea=Area;}}Frames.push(window.frames[i].document);}catch(err){Debug.push('EXT_FRAME');}}var%20FontStyle=['font','13px%20Trebuchet%20MS,%20Helvetica,sans-serif'];var%20FontStyleSmall=['font','11px%20Trebuchet%20MS,%20Helvetica,sans-serif'];var%20FontStyleInput=['font','14px%20monospace'];var%20HashStyle=[['%23f00','%23fcc'],['%23060','%23cfc']];var%20FontStyleLink=[FontStyleSmall,['color','%23666'],['fontWeight','normal'],['textDecoration','underline'],['borderWidth','0'],['cursor','pointer']];var%20FontStyleToolbarLink=[FontStyleSmall,['color','%23ccc'],['fontWeight','normal'],['textDecoration','underline'],['borderWidth','0'],['cursor','pointer']];var%20RevealStyle=[['margin','8px%205px%202px%200'],['padding','5px%205px%203px%205px'],['width','auto'],['borderStyle','solid'],['borderWidth','1px'],FontStyleInput];var%20MessageStyle=[['margin','0%200%208px%200'],['padding','0'],FontStyle];var%20FieldPopData='data:image/gif;base64,R0lGODlhDQAOAJEAAAjOCPn%252B%252Bd343f%252F%252F%252FyH5BAEAAAMALAAAAAANAA4AAAIlhI83CRKhFoKAjouE0eBi81CdJ3ERWSWkx6ws4r5GLNOvzeJeAQA7';var%20FieldFoundData='data:image/gif;base64,R0lGODlhDQAOAIABAMzMzAAAACH5BAEAAAEALAAAAAANAA4AAAIchI8XyRDb1IvmzWgvyxrxXn2QJHqidlphurBWAQA7';var%20TestImage=new%20Image;TestImage.src=FieldPopData;var%20FieldFoundStyle=(TestImage.complete)%3F'%23fff%20url('+FieldFoundData+')%20no-repeat%20top%20right':'%23fff%20url(http://files.supergenpass.com/img/sgp0.gif)%20no-repeat%20top%20right';var%20FieldPopStyle=(TestImage.complete)%3F'%23fff%20url('+FieldPopData+')%20no-repeat%20top%20right':'%23fff%20url(http://files.supergenpass.com/img/sgp1.gif)%20no-repeat%20top%20right';delete%20TestImage;var%20Len=false,Hash=false,Salt=false,DisableTLD=false,GenPasswd=false,PrevPasswd=false,PrevPasswdPop=false,Populated=false,Unpopulated=false,ScrollPosition=false;var%20BoxPosition=[0,0];var%20Snippets=['You already have a SuperGenPass window open.','Are you sure you want to run SuperGenPass again?','Enter your master password.','Your generated password','Your master password','VERIFIED','INVALID','Regenerate password','Master password','Domain / URL','Disable subdomain removal','Password length','Submit','Double-click to populate','help','close','show/hide','220px'];if(Target%26%26TargetWindow){gp2_genpass(0,0,16,0,0,0);}else{if(confirm(Messages[3])){window.location='http://www.supergenpass.com/mobile/';}}})();</div>
<body>
</html>
每次输出div 应在每次搜索和替换后显示结果 - 但我得到的结果不一致: 例如,名为output2的div仅包含10%或初始文本! 每个输出div 应该具有相似的长度!
我做错了什么?
我准备了一个沙箱供您查看:http://jsfiddle.net/vMeq6/1/
答案 0 :(得分:0)
因为您使用的是html,所以认为&lt;是一个HTML标签的开始!如果要调试,请使用JavaScript控制台,而不是div元素。
你基本上只是重新创建了unescape。
您的整个代码可以简化为此
var content = $("#input").text();
console.log(unescape(content));