JavaScript can play a big role in web programming, writing some of the most common features into JavaScript libraries.
Save the following code as Common.js
Class Library Features:
1.Trim (str)--Remove the spaces on either side of the
In the actual programming process, sometimes we will encounter a situation: When you have an object A, at a certain moment, a has already saved the corresponding attribute value, and the values themselves are valid, this time may require a exactly
JS Array supports two methods, Shift () and pop (), which is to delete a value from the front and back of a data, and to delete the value. Look at an example and you'll see:
The code is as follows
Copy Code
var arr = ['
High self-adaptation of IFRAME in the same domainThe following code is compatible with the Ie/firefox browser, which controls the height of the iframe with id "Iframeid", gets the final height of the nested page through JavaScript, and then sets it
Join () Method:Method Array.join () converts all elements of an array to strings and then joins them. You can specify an optional string to separate the elements in the result string. If a delimited string is not specified, the element is separated
Window objects and browser windows 1:When a new document is loaded into a window or frame, the window object of that Windows or frame is reset to the default state, that is, all the properties and functions defined by the script in the previous
The default skin for these three nodes is three colors, and each node can be skinned independently and unaffected. Once the skin of a node has been replaced, the skin of the list page and content page under this node will also be replaced with it.
One, JS no other than the number of character index arrayof course! Can do that when the results are not what you thinkThe most common is array ()The Array object is used to store multiple values in a single variable.
To create the syntax for an
The replace () method replaces some characters in a string with some other characters, or replaces a substring that matches a regular expression.
GrammarStringobject.replace (regexp/substr,replacement)
return valueA new string that is replaced
The code is as follows
Copy Code
Example Two
The code is as follows
Copy Code
js Pre-upload preview pictures compatible IE6, ie7Select Picture:
But browse small graph Div will
Let's take a look at a simple JS basic Introductory Tutorial , the use of classes to create changes, such as Oh, JavaScript introductory tutorials, create, JS tutorials, Getting started, JavaScript instantiation
The throw declaration allows you to create an exception.ExampleThe Throw statementHow to use throw.
Throw statementThe throw declaration allows you to create an exception. If you use this statement with the attempt ... catch statement, you can
This code can verify the mobile phone, mailbox, QQ, telephone, IP, data, Chinese characters, user name legality, mailbox, etc. oh.var fk;var mode;validator={Errinput: ' Errinput ',ErrMsg: ' ErrMsg ',ERRCLS: ' No ',YESCLS: ' Yes ',
Require:/[^ (^s*)
Tip: You can modify some of the code before running
native JavaScript effect: Focus map OriginalJavaScript effects: Focus graph 12 3 4 > & Lt;/html>
Tip: You can modify some of the code before
Tip: You can modify some of the code before running
javascript title content Focus Graph Toggle Effect
Aaron Kwok refused to marry the door Lynn sweep the bargain http://www.zongxy.com/ star worth with the box office
Tip: you can modify some code before running Native javascript effect: Simple dragNative javascript effect: Simple dragMming simple drag and drop example Tip: you can modify some code before running
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.