JavaScript Practical Skills Collection (3)

Source: Internet
Author: User
Skills

21. Make pop-up windows always on top:

<body onblur= "This.focus ();" >

22. Do not scroll bar?

Let the vertical bar not:
<body style= "Overflow:scroll;overflow-y:hidden" >
</body>
Let the cross bar not:
<body style= "Overflow:scroll;overflow-x:hidden" >
</body>
Two of them removed? It's even simpler.
<body scroll= "No" >
</body>

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

<a href= "#" ></a>

24. e-mail processing submitting form

<form name= "Form1" method= "Post" action= "mailto:****@***.com" enctype= "Text/plain" >
<input type=submit>
</form>

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

<body >
The location where the page opens <body >

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

<STYLE>
Body
{Background-image:url (logo.gif); background-repeat:no-repeat;
Background-position:center;background-attachment:fixed}
</STYLE>

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

<script language= "Javascript" ><!--
function Checknum (str) {return Str.match (//d/) ==null}
Alert (Checknum ("1232142141"))
Alert (Checknum ("123214214A1"))
--></script>

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");



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.