1. Use the submit button to submit and perform form verification on the onsubmit event in the Form:
CopyCode The Code is as follows:
2. Use the onclick event of a button or image to call the Form Verification Code:Copy codeThe Code is as
Many cool people in the garden have already written these
Article But most examples are. net, today I want to cite a JS use instance. if you are interested, you can first take a look at some cool people, such as the observer section in the Design
CopyCode The Code is as follows: // dateobj is a date object. days indicates how many days are added to the date, for example, 4 or 5 days)
Function dateadd (dateobj, days ){
VaR tempdate = dateobj. valueof ();
Tempdate = tempdate + days * 24*60*60*1
The visibility definitions of JavaScript Object structures can be divided into the following types:
1. Private Properties)
The VaR keyword defines the scope of the variable in the object construction. The variable can only be accessed within
Jquery's selector is really powerful and flexible. The original JavaScript method is also worth studying.
CopyCode The Code is as follows:
obtain the number of checkboxlist selected (jquery vs. JavaScript/front-end and back-end)
In particular, when downloading JavaScript files, parallel downloads are actually disabled and page rendering is blocked!
JavaScript download
When downloading a JavaScript script file, the browser does not start other downloads in parallel. Instead,
On the other hand, JavaScript is usually closely integrated with the host environment (such as a browser), so it lacks powerful and easy-to-use development tools. In such an environment, developing components or frameworks becomes a challenging task.
1. Save the html page to word
Copy codeThe Code is as follows:
cell 1
Cell 2
cell 3
cell 4
cell merging
& Lt; table id = "Test" width = "100%" & gt;
test
2. Use JS to generate WORD
Copy codeThe Code is as follows:
Originally, we wanted to use Array to store data. We didn't try to use JS to structure the data. Let's try it with JS.
JS efficiency is really low. When a linked list is installed with 1000 object browsers, it prompts that the operation is
For complex operations, such as adding a row, it may be difficult to perform related operations on this row. I prefer to use templates and Mark data filling in the presentation layer, so I made a small component and shared it with
IndexOf
Returns the index of the element in the array. If no index exists,-1 is returned. Similar to the indexOf method of string.
If other browsers do not implement this method, use the following code for compatibility:
Copy codeThe Code is as
:
In fact, the learning method is to search for methods to solve problems faster.
Search Method: javascript calendar control site: jb51.net |
script select Date:
The general practice is to first determine the number of months, and then determine the number of days (usually with a switch), if it is February, You have to determine whether the selected year is a leap year, then decide whether it is 28 days or 29
The regular expression can be:
• Test a mode of a string. For example, you can test an input string to see if there is a phone number or a credit card number. This is called Data Validity verification.
• Replace text. You can use a regular
I. References
Copy codeThe Code is as follows: // generate an array object
Var items = new Array ('1', '2', '3 ');
// Point a reference to this object
Var itemRef = items;
Items. push ('4 ');
// Items and itemRef point to the same object
Alert
Split definition and usage
The split () method is used to split a string into a string array.
Syntax
StringObject. split (separator, howator) parameter description
Separator is required. String or regular expression, which separates stringObject
Copy codeThe Code is as follows: var obj = document. getElementById ("name ");
Function clickMe (){
Alert (this. value );
This. value + = "!!!! ";
Alert (this. value );
}
Var ActionBinder = function () {// define a class
}
ActionBinder. prototype.
Problem: Make a pop-up layer effect with a drag (like in the prompt box)
I wrote about it in half and will continue to struggle tomorrow:
Xmlns = "http://www.w3.org/1999/xhtml">
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