In js, call and apply are used to bind functions to another object for running. The two functions are different only when defining parameters, next I will introduce the call and apply usage.
In the web Front-end development process, we often need to
This article will introduce offsetLeft, offsetTop, and offsetParent in js. If you are interested in this tutorial, please refer to it.
As a front-end development engineer, are you sure you really understand offsetLeft, offsetTop and offsetParent?
Recursive functions are called by the function itself. recursive functions are often used in non-hierarchical data applications, such as the unlimited classification of navigation menus. Next I will introduce the use of js recursive
I have two methods to read JSON in js: obj. name-based access, and array-based access. I will share with you the introduction and examples below.
Method 1: function construction definition method return
The Code is as follows:
Copy code
In js, if we want to add things such as div, we almost only use the following methods: onclick, DOM. onclick = function () {}, DOM. addEvent (), now there are a lot of things to add with jquery binding. I will find some related examples for your
I want to share with you an article about how to skillfully use the inert loading of functions to improve the javascript code performance. I hope this tutorial will be helpful to you.
In JavaScript code, because of the behavior differences between
Js cookie: we only need to delete the cookie when the expires expiration time is available. Set the cookie to operate on the document. cookie. Let's take a look at several related functions.
Cookies are a set of data stored on the client after the
In js, the character truncation function has three common slice (), substring (), and substr (). Next I will introduce slice () and substring () and substr () functions are used and different in character truncation.
Three Functions of the string:
Ajax request methods include get and post methods, but they return many Status values, and each piece of code represents a different meaning. Let's look at the meaning of various codes, I hope this will help you.
Note: XMLHttpRequest is the basis of
The following are some common examples by using the random number function. The examples include: generate random color values, number of random two numbers, and random number method.
JS Random Number Method
The following method applies to hidden
In js, array sorting uses array. sort (). The following is an example of sort () array sorting, hoping to help you.
By default, the sort () method arranges array items in ascending order-that is, the smallest value is located at the beginning, and
A more practical testing of the javascript pop-up layer pop-up scan, I hope it will be helpful to all of you.
Js click a button to bring up a layer and cover the content behind the page to make it translucent. This effect is widely used, for example,
A function can contain parameters or no parameters. functions without parameters are mostly used for fixed operations. parameters are the most meaningful part of a function. Of course, anonymous functions do not have parameters.
The previously
Page delayed loading is generally like some advertisements, images, statistics code, and so on. I hope they will not affect the opening and normal browsing of the website. I usually use delayed loading, let's take a look at a simple method of
There are many rounding functions in js, such as toFixed and Math. round () and Math. pow () and other functions. The following articles mainly introduce toFixed and Math. round () and Math. do not miss out on the four functions of pow.
Previously,
Data in jQuery ajax is sent to the server in the form of Key-Value pairs (Key/Value). When Using ajax to submit form data, you can use jQuery ajax's serialize () method form serialization to key-value pairs (key1 = value1 & key2 = value2 ...) And
First, Ajax requests data (using Jquery's Ajax)Copy codeThe Code is as follows: The backend processes the request and returns data in Json format (Thinkphp is used)Copy codeThe Code is as follows:$ List = $ File-> group ('num')-> order ('Id desc')->
In this example, the province and city levels are linked. If you select a city that saves time, the city that saves the time will be displayed in another drop-down box. In this example, AJAX transfers the data obtained by parsing the XML file back
Copy codeThe Code is as follows:Server:Public void doGet (HttpServletRequest req, HttpServletResponse resp)Throws ServletException, IOException {Req. setCharacterEncoding ("GBK ");// Create a new SmartUpload objectSmartUpload su = new SmartUpload ();
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