神奇的代碼——JavaScript在瀏覽器中的妙用

  現精心從網上淘了一些有價值的JavaScript代碼,有興趣的可以試試。方法:將給出的代碼複製到瀏覽器地址欄(如果你夠笨,那你就對照着一個字符一個字符的敲吧,我暈~~)然後回車就行了。

        1.在任意網站上隨意塗鴉

       javascript:document.body.contentEditable='true'; document.designMode='on'; void(0)

        這是一段神奇的代碼,利用此代碼黑掉Google、Baidu……簡直就是舉手之勞啊!只要你在IE瀏覽器任意打開一個網站,然後在瀏覽器上輸入前面這段代碼然後回車,你就可以隨心所欲的修改這個網站啦!想想google的頁面被自己改得面目全非,是不是過足了黑客癮啊!

       輸入如下代碼,將退出編輯狀態:javascript:document.body.contentEditable='false';void(0)

        2.更改網頁,讓圖片脫離網頁飛行

        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.sin(R*x1+i*x2+x3)*x4+x5; DIS.top=Math.cos(R*y1+i*y2+y3)*y4+y5}R++}setInterval('A()',5);void(0);

        3.解除右健鎖定

        javascript:functiondocument.oncontextmenu(){return true;} function document.onselectstart(){returntrue;} function document.onsdragstart(){return true;}

        4.顯示網頁中的所有圖片

       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!')}

        5.顯示網頁中除圖片的其他

       javascript:for(jK6bvW=0;jK6bvW<document.images.length;jK6bvW++){void(document.images[jK6bvW].style.visibility='hidden')}

        6.顯示網頁源代碼(對於加密過的可以直接顯示其加密前的源代碼)

       javascript:s=document.documentElement.outerHTML;document.write('<body></body>');document.body.innerText=s;

        7.網頁放大1.5倍

       javascript:void(s=document.body.style);void(z=s.getAttribute('zoom'));if(z){s.setAttribute('zoom',(parseInt(z)+50)+'%');}elses.setAttribute('zoom','150%')

        8.網頁縮小0.5倍

       javascript:void(s=document.body.style);void(z=s.getAttribute('zoom'));if(z){s.setAttribute('zoom',(parseInt(z)-50)+'%');}elses.setAttribute('zoom','50%')

        9.把隱藏的表單顯示出來

       javascript:for(i=0;i<document.all.length;i++){document.body.all[i].maxLength=2147483647;document.body.all[i].outerHTML=document.body.all[i].outerHTML.replace(/type=(radio)|(hidden)|(checkbox)/i,'type=text');}void(0)


再發一些Javascript和Html5結合起來實現的絢麗效果。

3D玫瑰

http://www.csdn.net/article/2012-02-09/311621

3D聖誕樹

http://www.csdn.net/article/2010-12-24/286274

3D小蜜蜂

http://www.lupaworld.com/article-223032-1.html

more

http://js1k.com/2010-xmas/demos


 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章