In JAVASCRITP, there are two dedicated functions for timers, respectively:
1. Inverted timer: Timename=settimeout ("function ();", delaytime);2. Cycle Timer: Timename=setinterval ("function ();", delaytime);
The first parameter "function ()" Is
Copy Code code as follows:
to validate a regular expression set of numbersVerify Number: ^[0-9]*$
Verify the N-bit number: ^\d{n}$
Verify at least n digits: ^\d{n,}$
Verify the number of m-n bits: ^\d{m,n}$
Verify numbers
Common Getelementbyid,getelementsbyname,getelementsbytagname. But foreigners are not satisfied with these APIs, and then made a getelementsbyclassname, and then a little bit of jquery selector, here only said the original JS
When it comes to table sorting, the first thing to say is the sort of array, because array sorting is the basis for table sorting.
JavaScript provides a sort () method for table sorting by default, which causes arrays in an array to be arranged in
1, JS part of the Code
Copy Code code as follows:
/**
* Submitting Form
*/
function SubmitForm (action, Actname, objname, Formname,blogtype) {
$ ("#" +formname). attr ("action", action);
var f =
In the front-end development process, we often encounter problems with adding events to page elements, add the event of the JS method is also a lot of directly added to the page structure, there is a use of some JS event monitoring method, due to
HTML () method
This method is similar to the innerHTML property in JavaScript, and can be used to read or set HTML content in an element. To get the contents of an element, you can do this:
Copy Code code as follows:
var p_html = $
var arr=[' A ', ' B ', ' C '];There are two ways to delete a ' B ' in it:
1.delete method: Delete Arr[1]
This way the array length does not change, at this time arr[1] becomes undefined, but also has the advantage the index of the original array
JS weak type makes people feel a lot of things are more confused, for example, if a variable is true or false in the IF condition, type conversion is required if a non-Boolean variable in a strongly typed language is placed in the IF condition, but
An element is still, making it move automatically on the screen.
This is a relatively simple problem, encountered in the study, wrote it down.
Copy Code code as follows:
suspend
0
It's a total number of clicks per click, right?
1. You can drag a hidden button control on the server side, and then write the click event of the button, which is used to fetch the total number of clicks from the database.
2. Assign the number of
Others, such as the Third-party modules (Third-party modules) or local modules (which are installed through NPM), expose a public API for each module. So that developers can import. Such as
Copy Code code as follows:
var mod =
In "on-demand" requirements, we often judge that when the script is loaded and returns a callback function, how do you judge the completion of the script's loading?
We can be loaded JS object using onload to judge (Js.onload), this method Firefox2,
This article mainly introduced JS use for loop coordinate array traversal child node lookup element
function Nextchildnode (node,clazz,tagname) {
var count= node.childelementcount;
for (Var i=0;i
1, so that the right key and replication failure
Method 1:
Add the following code to the Web page:
Copy Code code as follows:
Method 2:
Add the following code to :
Or
Essentially, Method 2 is the same as Method 1.
Method 3
Click the button how to jump to another page? We may be required in the production of the website, because sometimes we need to do this effect, especially the button into a picture, and click on the picture to jump to the new page, how to do it?
Learning materials
1. Node.js in simple and lucid2.node.js Development Guide
Introduction (Just pick up what I think is important)
Node.js is a platform for JavaScript to run out of the browser on a server, not a language;
Node.js uses a
Oschina, that's mine too, now put it here, haha
This piece of code can only upload one file at a time ~ ~
Copy Code code as follows:
var path=require ("path");
var fs=require ("FS");
var http=require ("http");
Post Value payload
TextArea is called a text field, also known as a text area, a multiline text input control with a scroll bar that is often used in a Web page submission form. Unlike a single-line text box, the text control does not limit the number of words by the
Copy Code code as follows:
latitude and longitude according to the address of the query
To query the address:
Query results (latitude and longitude):
Style= "Position:absolute;
margin-top:30px;
width:730px;
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