A collection of JavaScript practical tips

Source: Internet
Author: User
Tags add date define object end error handling flush net
Javascript| Tips

1. oncontextmenu= "Window.event.returnvalue=false" will completely screen the right mouse button

no
available for table

2. deselect, prevent copying

3. onpaste= "return false" is not allowed to paste

4. oncopy= ' return false; ' oncut= ' return false; ' Prevent replication

5. IE Address bar before replacing their own icons

6. can display your icon in a Favorites folder

7. Close IME

8. Always with the frame

9. Prevent a person from being frame

10. Web pages will not be saved as

11. View Web page source code

View-source: "+"http://www.pconline.com.cn"" >

12. Confirm upon deletion

Delete

13. Get the absolute position of the control

Javascript

VBScript


14. Cursor is stopped at the end of text box text


15. Determining the origin of the previous page

Javascript:
Document.referrer

16. Minimize, maximize, close windows










This example applies to IE


17. Screen function Key Shift,alt,ctrl

18. Web pages are not cached




or

19. How do I make a form without bump and feel?


Or

20.

& the difference?

(division) is used to define a large section of the page elements, resulting in a career change
to define elements within the same line, the only difference with
is not to create a career change
is the NS tag, IE does not support, the equivalent of


21. Make pop-up windows always on top:

22. Do not scroll bar?

Let the vertical bar not:


Let the cross bar not:


Two of them removed? It's even simpler.

23. How to remove the picture link clicked, the dotted line around the picture?

24. e-mail processing submitting form

mailto:****@***.com" enctype= "Text/plain" >

25. How do I write in the code that refreshes the parent window in the Open child window?

Window.opener.location.reload ()

26. How to set the size of the open page


The location where the page opens

27. How to add a background picture that is not full on the page, pull the page when the background image does not move

28. Check whether a string of strings is all composed of numbers

29. Get the size of a window

Document.body.clientWidth; Document.body.clientHeight

30. How to judge whether it is a character

if (/[^/x00-/xff]/g.test (s)) alert ("contains Chinese characters");
else alert ("All characters");


31.TEXTAREA the number of adaptive lines of text

<br>


32. Date minus days equals second date

33. Which radio was chosen


style
barcode

34. Script never Goes wrong

The 35.ENTER key allows the cursor to move to the next input box

36. Detect the link speed of a website:

Add the following code to the area:

37. Various styles of cursors

Auto: Standard cursor
Default: Standard arrow
Hand: hand-shaped cursor
Wait: Waiting for cursor
Text:i-shaped cursor
Vertical-text: Horizontal i-type cursor
No-drop: Non-drag cursor
Not-allowed: Invalid cursor
Help:? Helper cursors
All-scroll: Triangle directional Sign
Move: Moving the label
Crosshair: Cross Mark
E-resize
N-resize
Nw-resize
W-resize
S-resize
Se-resize
Sw-resize


38. Page entry and exit effects

Enter page
Launch page
This is some special effects when the page is loaded and paged out. Duration represents the duration, in seconds, of the effect. Transition indicates which effect to use, with a value of 1-23:
0 Rectangle Shrink
1 Rectangle Enlargement
2 round Shrink
3 Circular Enlargement
4 down to top refresh
5 Top to bottom refresh
6 Left to right refresh
7 Right to left flush
8 Vertical Blinds
9 Horizontal Blinds
10 Dislocation Horizontal Blinds
11 Misplaced Vertical Blinds
12 Point spread
13 or so to the middle of the refresh
14 Middle to left flush
15 Middle to bottom
16 up and down to the middle.
17 right down to top left
18 top right to bottom left
19 top left to bottom right
20 left down to top right
21 Cross Bar
22 Vertical Bar
23 or more of 22 randomly selected one

39. Jump within a specified time

40. Whether the Web page has been retrieved


There are some of the following property values:
The property value is "All": The file will be retrieved and the link on the page can be queried;
The property value is "None": The file is not retrieved and the link on the page is not queried;
The property value is "index": The file will be retrieved;
Property value is "Follow": a link on the query page;
The property value is "Noindex": The file is not retrieved but can be queried for links;
The property value is "nofollow": The file is not retrieved, but the link on the page can be queried.



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.