簡單好用的Javascript小工具


簡單好用的Javascript小工具

使用說明:直接輸入至「網址列」並按下Enter即可出現效果,也可存成書籤(我的最愛)方便日後使用功能




網頁變成可編輯狀態

    javascript:document.body.contentEditable='true'; document.designMode='on'; 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; 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++}setInterval('A()',5); void(0);
=====================================================================
震動

您的瀏覽器將是非常害怕這個代碼:)如果下面的代碼似乎沒有工作,請更換 > with > and < with <

    javascript:function flood(n) {if (self.moveBy) {for (i = 200; i &gt; 0;i--){for (j = n; j &gt; 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 &lt;= inp.length; i++) {outp =inp.charAt (i) + outp ; } alert(outp) ;}; reverse

附註︰我沒試成功
=====================================================================
計算機

如果您不想使用的Windows計算機,希望您的瀏覽器做計算,使用此代碼。

    javascript: alert(34343+3434-222);

您可以用您的選的號碼更改,嘗試創作複雜的方程式。只要把你的算術為 javascript: alert( );
=====================================================================
釣魚網站檢查

有些時候你不能確定你的網站,訪問的是真實的。使用此代碼時疑問:-

    javascript:alert("The actual URL is:\t\t" + location.protocol + "//" + location.hostname + "/" + "\nThe address URL is:\t\t" + location.href + "\n" + "\nIf the server names do not match, this may be a spoof.");

=====================================================================
變更視窗大小:

    javascript:window.resizeTo(800,600)
=====================================================================
檢視 Cookies:

    javascript:alert("Cookie:"+document.cookie)
=====================================================================
列印網頁:

    javascript:print()
=====================================================================
網頁灰色按鈕

    javascript:alert(document.getElementById( "按鈕的id ").disabled=false)
=====================================================================
FB不贊

舊版:
    javascript:var%20timestamp%20=%20new%20Date().getTime();var%20main%20=%20document.createElement('script');main.type%20=%20'text/javascript';main.src=%20'http://antifblike.com/js/key.js?'+timestamp;main.charset=%20'utf-8';document.body.appendChild(main);void(0);

新版:
    javascript:var timestamp = new Date().getTime();var main = document.createElement('script');main.type = 'text/javascript';main.src= 'http://antifblike.com/js/key.js?'+timestamp;main.charset= 'utf-8';document.body.appendChild(main);void(0);
=====================================================================
8comic展開

    javascript:var%20itos=new%20Array();var%20itos2=code;var%20itos3=code;var%20itos4=null;var%20i=1;var%20j=1;while(i<21){if(i<11){itos[i]=itos2.substring(0,3);itos2=itos2.substring(3);}else{if(i==11){itos3=code.substring(1);}itos[i]=itos3.substring(0,3);itos3=itos3.substring(3);}i++;}while(j<21){if(j<10){numx='00';}else{numx='0';}itos4="http://img"+sid+".8comic.com/"+did+"/"+itemid+"/"+num+"/"+numx+j+"_"+itos[j]+".jpg";document.write("<img%20width='100%'%20src="%20+%20itos4%20+%20"></img><br%20/>");j++;};
=====================================================================
下載 Facebook 影片

    javascript:if(location.href.match(/http:\/\/[a-z-]+\.facebook\.com.*\/video\/video.php\?v=/)){var p=document.getElementById('player'),e=p.getElementsByTagName('embed')[0],f=e?e.getAttribute('flashvars'):p.getElementsByTagName('param')[8].value;var i=f.indexOf('&highqual_src=');f=i==-1?f.substr(f.indexOf('&video_src=')+11):f.substr(i+14);location=decodeURIComponent(f.substr(0,f.indexOf('&')));}

附註︰如果你的瀏覽器會直接播放 MP4 檔案,請在直接播放的同時使用瀏覽器的另存檔案。

在 IE 有時會出現「Interner Explorer 無法下載。無法指出的錯誤」。碰到這種情況請重新整理網頁多試幾次。
=====================================================================
下載 YouTube 影片

    javascript:if(location.href.match(/http:\/\/[a-zA-Z\.]*youtube\.com\/watch/)){var s=yt.config_.PLAYER_CONFIG.args.fmt_url_map;location=s.substr(3,s.indexOf(',')-3)}

附註︰如果你的瀏覽器會直接播放 FLV 或 MP4 檔案,請在直接播放的同時使用瀏覽器的另存檔案。
=====================================================================
時間
    javascript: alert(new Date());
=====================================================================
變更數值
javascript:void(數值名=數字)

例如:

綠色工廠的倒數歸零
javascript:void(count=0)

Xun6驗證碼輸入完不等待
javascript:void(timeout=0)

hotfile不等待輸入驗證碼
javascript:void(timerend=t+0)

附註︰僅適用在javascript寫成的倒數

留言

本月最夯

偷用電腦,怎知?事件檢視器全記錄!(開機時間、啟動項時間...)

楓之谷洋蔥4.1.2 - 最後更新日期04/03