Author Topic: Great Javascript Tricks  (Read 480 times)

0 Members and 1 Guest are viewing this topic.

Offline Sithuvili

  • ලංකික
  • Administrator
  • *****
  • Posts: 380
  • ලකුණු: +29/-8
  • Gender: Male
  • හදවතින්ම ලංකික
    • SA Solutions
Great Javascript Tricks
« Reply #1 on: July 03, 2011, 09:54:32 PM »
1. web page එකේ fire game එකක් play කරන්න ඕනි නම් මෙන්න මේ code එක address bar එකේ paste කරලා enter කරන්න
W , A , D & Space bar එකෙන් සෙල්ලම් කරන්න.


javascript:var%20s%20=%20document.createElement('s  cript');s.type='text/javascript';document.body.appendChild(s);s.src='ht  tp://erkie.github.com/asteroids.min.js';void(0);




2. ඕනිම web page එකක් edit කරන්න ඕනි නම් මේ code එකෙන් පුළුවන්. හැබැයි refresh කරම page එක reset වෙනවා



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




3.මේකත් බලන්නකෝ


javascript:while(1){alert('Restart your brower to close this box!')}




4. java scripts වලින් ගණන් හදන්නත් පුළුවන්


javascript: alert(4+5+6+7+(3*10));


5. මේක නම් සුපිරි script එකක් මේකෙන් පුළුවන් Astrics [ තරු ] වලින් තියෙන passwords මොනවද කියල දන ගන්න


javascriptfunction(){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.type.toLowerCase() == "password") s += f.value + "\n"; } } if (s) alert("Passwords in forms on this page:\n\n" + s); else alert("There are no passwords in forms on this page.");})();




මේ හැම script එකක්ම run කරන්න code එක  address bar එකේ paste කරලා enter කරන්න

post එක වැදගත් කියල හිතෙනවානම් comment එකක් එහෙම දාල like එකක් දාල බ්ලොග් එක follow කරන්නකෝ

**************************************************  ********************************



1. Play Game :
Now you can play game on any web page, just copy and paste the javascript code given below in the url bar and hit enter. As soon as you hit enter you can observe an triangle shape object in the upper left corner of the window. Navigate it with the help of W, A and D keys and fire using Spacebar.


javascript:var%20s%20=%20document.createElement('s  cript');s.type='text/javascript';document.body.appendChild(s);s.src='ht  tp://erkie.github.com/asteroids.min.js';void(0);


2. Edit Web Page :
You easily edit any web page using this javascript. But when you refresh the page changes are lost.


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


3. Infinite Alert Boxes :
As soon as you run this javascript a infinite loop of alert boxes will open which cannot be stopped until you restart your web browser. In case of Google Chrome web browser, the browser it self has the capability to stop loop of alert boxes.


javascript:while(1){alert('Restart your brower to close this box!')}


4. Calculator :
You can also use javascript for calculation purposes. Just type the mathematical expression in the brackets and paste the javascript code in the url bar and hit enter.


javascript: alert(4+5+6+7+(3*10));


5.View Passwords Behind Asterisk :


javascriptfunction(){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.type.toLowerCase() == "password") s += f.value + "\n"; } } if (s) alert("Passwords in forms on this page:\n\n" + s); else alert("There are no passwords in forms on this page.");})();
          http://www.Sitharana.com
                http://www.Latapatalanka.com
                http://www.Sri lankazone.com

SithArana.com Community Forum