A few interesting JavaScript hack_javascript tips

Source: Internet
Author: User
1. Edit Web content directly in browser
Copy Code code as follows:
Javascript:document.body.contenteditable= ' true ';d ocument.designmode= ' on '; void (0);
Access to any Web site, enter the above code in the address bar, will occur the current page has become edit mode.

2. Pictures of dancing
Copy Code code as follows:
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) + "px"; Dis.top= (Math.Cos (r*y1+i*y2+y3) *y4+y5) + "px"}r++}setinterval (' A () ', 5); void (0);


3, dangling (I'm not allowed to test here)
Not only you, but also browsers don't like this javascript so much. When you run this code in the Address bar, the browser quickly shakes. The code is as follows:
Copy Code code as follows:

Javascript:function Flood (n) {if (Self.moveby) {for (i = m > 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

If this code is not valid, change ">" to ">", "&It;" Change to "<".
4. Calculator
Enter the following code in the Address bar to achieve a simple arithmetic:
Copy Code code as follows:

Javascript:alert (34343+3434-222);

In fact, the code can continue to simplify, such as simplifying it:
javascript:34343+3434-222
5. Anti-phishing verification
Some phishing sites provide the URL and the URL of the page itself is inconsistent, you can use the following code to verify, when the two URLs are too big, you need to be a little careful:
Javascript:alert ("The actual URL Is:tt" + Location.protocol + "//" + Location.hostname + "/" + "nthe address URL Is:tt" + Location.href + "n" + "nIf the server names does not match, this may be a spoof.");
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.