1. The () parentheses operator is usually used to call a function.
CopyCode The Code is as follows: // fun1
Function fun1 (){
Alert ('I was called ');
}
Fun1 ()
// Fun2 with ParametersFunction fun2 (PARAM ){Alert (PARAM );}Fun2 ('I was called ')
Use Regexp's explicit constructor. Syntax: New Regexp ("pattern" [, "Flags"]).
Use Regexp's implicit constructor in plain text format:/pattern/[flags].
The pattern part is required for the regular expression pattern text to be used. In the first
I. appending rows to a table
In your past experiences with Ajax, you may use JavaScript to append rows to an existing table, or create a new table containing table rows from the beginning. The document. createelement and document. appendchiid
Program Description
Colorgrads color gradient]
The colorgrads program uses startcolor and endcolor to generate a color gradient set.
Colors can be expressed in red (R), Green (G), and blue (B.
The program first converts the general color
At least each criptoo Attempt
Program Members spend a lot of energy on the simulation of the object-oriented mechanism rather than the business itself.
This is hard to imagine for Java, C ++, and even PHP developers.
What's worse is that simulating
This
This indicates the current object. If this is used globally, it indicates the current page Object window. If this is used in the function, this indicates what is called Based on the object on which the function is called at runtime. We can
CopyCode The Code is as follows :/**
* Get the length of Chinese and English characters
* @ Param {} Str
* @ Return {}
*/
Function lengthb (STR ){
VaR p1 = new Regexp ('% u ..', 'G ')
VaR P2 = new Regexp ('%.', 'G ')
Return escape (STR). Replace (P1,
CopyCode The Code is as follows: function xmlobject ()
{
This. isie = true;
If (window. activexobject) {isie = true;} else {isie = false ;}
VaR node_xml;
VaR xmldoc;
If (isie ){
Xmldoc = new activexobject ("msxml2.domdocument ");
}
Else {
If
Javascript Form Verification Regular Expressions
Use a regular expression to determine whether it is a 0-9 Arabic number
CopyCode The Code is as follows: function regisdigit (fdata)
{
VaR Reg = new Regexp ("^ [0-9] $ ");
Return (Reg. Test (fdata ));
We may often troubleshoot the cause of the problem. In fact, after checking out the redundant loop and streamlining the number of controls, we found that the performance was still not optimistic, So we continued to troubleshoot the problem, an
Couplet
CodeTo check its expression in XHTML. The result is very simple. This is because, according to the standard, the scroll bar of the form we see should not be the body, but the HTML (that is, the document.doc umentelement object). Therefore,
The direct character count of the regular expression.Character matchingAlphanumeric characters themselves\ O nul character (\ u0000)\ T-bit table (\ u0009)\ N linefeed (\ u000a)\ V vertical bit table (\ u000b)\ F page feed (\ u000c)\ R press enter (\
Check the Code:
HTML:
Copy codeThe Code is as follows:
index
1
2
3
4
Index. js content:Copy codeThe Code is as follows :/*Author: binarytree*/// Fill in the local reference of the imageExt. BLANK_IMAGE_URL =
There are three types of objects in JavaScript:1. Internal object
Such as Array, Boolean, Data, Math, Number, Object, RegExp, String Object, etc.
These object systems provide us with their respective attributes and methods for calling.
2.
1. Starting from cookie writing.
Var the_date = new Date ("December 31,202 0 ");
Var expiresDate = the_date.toGMTString ();
Document. cookie = "userDefineCSS =" + escape (title) + "; expires =" + expiresDate;
The first sentence is the date
1. Set the element to get focus to listen for Keyboard Events
The biggest advantage of element focus is that keyboard events can be sent. By default, many elements in HTML can be focused, such as form elements and a-anchor links. However, most
Object-oriented and Object-basedAlmost every developer has development experience in object-oriented languages (such as C ++, C #, and Java. In traditional object-oriented languages, there are two very important concepts: classes and instances.
1. document. formName. item ("itemName ")
Note: in IE, you can use document. formName. item ("itemName") or document. formName. elements ["elementName"];
In Firefox, only document. formName. elements ["elementName"] can be used.
Solution: Use
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