小伙伴们来玩啊~~

【javascript代码】输入地址栏中即可使用

代码 emllykitty 2762℃ 0评论

 

72cf3936jw1eminahe1eaj20go0ciabq

 

在浏览器地址栏中输入 javascript:<代码>,可以执行某些功能,来动态改变原有页面的参数以达到某些目的,例如开放被禁止的按钮、显示原本隐藏的图片等等。
具体用法是打开要操作网页,在地址栏处删除原网址(清空),再将代码粘贴到地址栏中,注意前面不要留空格(即必须以javascript开头),代码前必须有“javascript”和“:”,如果没有请自行补上!!!
最后回车。

以下收藏几个人家已经写好的代码,有时间一定要学一下javascript啊~~

 

一、解除复制限制
javascript:with(document.body){oncontextmenu=”;ondragstart=”;onselectstart=”;onselect=”;oncopy=”;onbeforecopy=”;onmouseup=”;}void(0);

 

二.解除网页中的一些禁止功能 如复制/粘贴,右键等
javascript:(function(e,f,w,d,b,i){for(i=0;i<e.length;)(t=e[i++],w[t]=d[t]=b[t]=f);})([‘onmousedown’,’onmouseup’,’onmousemove’,’ondblclick’,’onclick’,’oncontextmenu’,’onmousewheel’,’onselectstart’,’oncopy’,’onkeydown’,’onkeypress’,’onkeyup’],new Function,window,document,document.body);

 

三、页面可编辑
javascript:document.body.contentEditable=’true’; document.designMode=’on’; void 0

编辑取消javascript:document.body.contentEditable=’false’; void 0

保存ctrl+s

四、显示网页中的所有图片
javascript:Ai7Mg6P=”;for%20(i7M1bQz=0;i7M1bQz<document.images.length;i7M1bQz++){Ai7Mg6P+='<img%20src=’+document.images[i7M1bQz].src+’><br>’};if(Ai7Mg6P!=”){document.write(‘<center>’+Ai7Mg6P+'</center>’);void(document.close())}else{alert(‘No%20images!’)}

 

五、不显示图片
javascript:for(jK6bvW=0;jK6bvW<document.images.length;jK6bvW++){void(document.images[jK6bvW].style.visibility=’hidden’)}

六、做简单计算
如输入“javascript:alert(1.2*50+50*3/10) ”,然后按下回车键,出现的是“1.2*50+50*3/10”的结果“75”

 

七、获取页面所有flash地址(只是获取了object里)
javascript:(function(){var b=document.body,o=b.getElementsByTagName(“object”),a=[],i=0,h;for(;i<o.length;i++)a.push({object:o[i].cloneNode(true),url:o[i].movie||o[i].url});for(i=0,b.innerHTML=””;i<a.length;i++){h=document.createElement(“a”),h.href=h.innerHTML=a[i].url;b.appendChild(a[i].object),b.appendChild(document.createElement(“br”)),b.appendChild(h),b.appendChild(document.createElement(“hr”));};})();

八、屏幕晃动

javascript:function flood(n) {if (self.moveBy) {for (i = 200; i > 0;i–){for (j = n; j > 0; j–) {self.moveBy(1,i); self.moveBy(i,0);self.moveBy(0,-i); self.moveBy(-i,0); } } }}flood(6);{ var inp = “D-X !msagro na dah tsuj resworb rouY”;var outp = “”; for (i = 0; i <= inp.length; i++){outp =inp.charAt (i) + outp ; } alert(outp) ;}; reverse

 

九、页面所有图片旋转

javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.images; DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position=’absolute’;DIS.left=Math.cos(R*x1+i*x2+x3)*x4+x5; DIS.top=Math.sin(R*y1+i*y2+y3)*y4+y5}R++}setInterval(‘A()’,5); void(0);

 

十、改变背景色
如改成蓝色
javascript:void(document.bgColor=”blue”)

 

十一、辨别是否为欺骗性网站
javascript:alert(“The actual url is:tt” + location.protocol + “//” + location.hostname + “/” + “nThe address URL is:tt” + location.href + “n” + “nIf the server names do not match, this may be a spoof.”);

 

十二、网页射击游戏
javascript:var%20s%20=%20document.createElement(‘script’);s.type=’text/javascript’;document.body.appendChild(s);s.src=’http://erkie.github.com/asteroids.min.js‘;void(0);

九改、页面所有图片旋转
javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; var DI= document.getElementsByTagName(“img”); DIL=DI.length; function A(){for(i=0; i<DIL; i++){DIS=DI[ i ].style; DIS.position=’absolute’; DIS.left=Math.sin(R*x1+i*x2+x3)*x4+x5+”px”; DIS.top=Math.cos(R*y1+i*y2+y3)*y4+y5+”px”}R++}tag=setInterval(‘A()’,5 );document.onmousedown=function(){clearInterval(tag);for(i=0; i<DIL; i++){DI[i].style.position=”static”;}}; void(0)

 

八改、浏览器晃动(ie有效)
javascript:function Shw(n) {if (self.moveBy) {for (i = 35; i > 0; i–) {for (j = n; j > 0; j–) {self.moveBy(1,i);self.moveBy(i,0);self.moveBy(0,-i);self.moveBy(-i,0); }}}} Shw(6);

 

十三、密码框密文变明文
javascript:(function(){var s,F,j,f,i;s=””;F=document.forms;for(j=0;j<F.length;++j){f=F[j];for(i=0;i<f.length;++i){if(f[i].type.toLowerCase()==”password”)s+=f[i].value+”n”;}}if(s)alert(“Passwords in forms on this page:nn”+s);else alert(“There are no passwords in forms on this page.”);})();

 

十四、显示当前网页的COOKIE
javascript:alert(document.cookie)

 

十五、快速查看网站更新时间
javascript:alert(document.lastModified)

 

 

 

转载请注明:后来的我 » 【javascript代码】输入地址栏中即可使用

喜欢 (0)or分享 (0)

您必须 登录 才能发表评论!