The example in this article describes the effect of a JavaScript popup box with text messages. Share to everyone for your reference, specific as follows:
Tooltips.js:
Position of the ToolTip relative to the mouse in pixel//var offsetx =
Needless to say, the key code looks like this:
---recovery start---
;form>
---recovery content end---
The above is a small series to introduce the JavaScript form Focus automatic switch code, I hope to help you!
In real-world development, it is common to perform a series of synchronous asynchronous operations sequentially. Or with the Baidu Hi Web version of the example, we have to get the contact list asynchronously, and then asynchronously get each
For example, the character of the page processing, JS regular expression validation, and so on. Below I will be my own shallow development experience comprehensive network of complex resources slightly consolidated, save oneself later to use when
Then record the JavaScript access style sheet
JavaScript can access the style attributes of elements in a Web page, such as:
Accessing the Style property through JS
Alert (document.getElementById ("main"). Style.backgroundcolor);
Change the Style
1, concat method[Action] combines multiple arrays, and this method does not change the existing array, it only returns a copy of the associative array.[Syntax] Arrayobj.concat (array1,array2,...)Instance
[Ctrl + A All SELECT
The JavaScript practical skills that Web developers must collect for your reference are as follows
1. Will completely screen the right mouse button
oncontextmenu= "Window.event.returnvalue=false"
no available for table
2. Deselect, prevent
JavaScript function call rule one
(1) Global function call:
function Makearray (arg1, arg2) {
return [This, arg1, arg2];
}
This is one of the most common ways to define functions. People who believe in learning JavaScript are not unfamiliar with
where obj.name = "select"; this sentence does not work as expected, whether it is to look at the generated HTML code or to observe the length of the array obtained using Document.getelementsbyname (), you will find that this name setting does not
1, typeof operator. There are no problems with functions, String, number, undefined objects of these types, but objects for array are useless:
JS Code
Copy Code code as follows:
Alert (typeof null); "Object"
Alert (typeof []);
Copy Code code as follows:
/*
Purpose: Verify the format of IP address
Input: Strip:ip Address
Returns: False if return true through validation;
*/
function IsIP (StrIP) {
if (IsNull (StrIP)) return false;
var re =/^ (\d+) \. (\d+) \.
High Simulation spring oscillator (compressed use version) after setting up the new activation element and then point me!! Run please activate & Lt;br> initial speed (in pixels per millisecond): " move interval (in milliseconds): half
1. mapeed.addresschooser ( demo address )
Mapeed.addresschooser is a JavaScript script that creates the effects of an address form and a map combination.
When you select and enter addresses in the address form, the location is displayed in real
Now the realization of rounded corners is generally used to control the picture, this method has its advantages (resulting in a rounded angle smoothing). But at the same time he also asked for a consistent picture, if you want to dynamically change
1. Can only enter the Chinese characters
2. Only numbers can be entered:
Simple prohibition of entering Chinese characters
Enter numbers and decimal points:
Onkeyup= "Value=value.replace (/[^\d{1,}\.\d{1,}|\d{1,}]/g,") "
JavaScript can only
1) typeof operator
typeof is a unary operator, and the return result is a string indicating the type of the operand. such as: "Number", "string", "Boolean", "Object", "function", "undefined" (can be used to determine whether a variable exists).
But
Written in front of the still ambiguous statement: JavaScript in this article refers to the general meaning of JavaScript, and not only the "self-proclaimed JavaScript" of the runtime environment; Global variables and global object properties refer
And to teach us a lot about how to learn the DOM method, feel really benefit ah.
Here are a few examples I'd like to share with you.
1. Level two Drop-down menu (level is the province, two is the city, the request level selected provinces, two
The prerequisite is to install the Firebug plug-in and the Aptanadebugger plugin, their download address is as follows:Http://getfirebug.com/releases/firebug/1.2/firebug-1.2.0.xpi
Http://firefox.aptana.com/update/aptanadebugger.xpi
To start
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