Call and apply in Javascript

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

JS Mobile Phone Touch screen event Usage Details

Now that smartphones are popular, we are engaged in touch screen events. In the past, JavaScript writing could not meet some requirements. Next I will introduce you to several js Mobile Phone Touch Screen events. Processing Touch events allows you

Identify browser code using JS userAgent

To obtain the browser information string in js, you only need to use navigator. userAgent. In this way, you can use indexof to determine the version or other information. The following describes several instances. The use of Javascript userAgent

Javascript browser or page close exit prompt information

The title may not be clearly written, indicating that the user is prompted to save the data before the user leaves the page or closes the browser, and whether to leave the page. Here we will use a window. onbeforeunload event. Example The

Clever Use of the function's inert loading to improve javascript code performance

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

External js loading for webpage delayed Loading

In applications, external js usually affects the website's opening speed and experience. In some JavaScript files, we can delay loading, next I will introduce the external js loading instance test of webpage delayed loading. I hope to help you. In

Js implementation form (textarea) Acquisition and focus usage

In js, onfocus and onblur are acquired and lost, while in jquery, focus and blur are both used. The two are slightly different. Let's take a look at them. In js, onfocus, onblur, onmouseover, and so on will be used. jquery binds events. The

JS disrupt the Array (random sorting to generate random numbers that are not repeated)

The method to achieve random sorting of arrays is actually very simple, but Baidu found that there are a large number of such instances, but I strongly recommend these three instances. The random sorting written by a foreign user is not repeated, it'

Application Examples of the js setTimeout Function

The setTimeout function is a scheduled function that can call a specified function every few seconds for operations. Below is an infinite loop instance, one is that the setTimeout function can pass the parameter/value passing instance, both of which

Common JavaScript code refresh current page

Use location. reload () or location. href to refresh the current page in js. Of course, we can use window. parent. frames to refresh the framework page. Let's take a look. Reload MethodThis method forces the browser to refresh the current

Js enables page Jump by keyboard combination

In the past, we used js to determine whether the user was submitting by pressing ctrl + enter. Next I will introduce two page Jump methods by pressing the keyboard combination key. Use a keyboard to redirect pages. Change the address after location

Introduction to sort () sorting instances in javascript

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

JSONP data format Optimization

Here are some tips for optimizing the data format of JSONP. I hope it will be helpful to you. When using JSON to transmit data, the field names are too repeated during list transfer, which wastes bandwidth and reduces efficiency. For example:

JS select all/select multiple good Checkbox instances

Because of the special nature of the Checkbox, we usually define a function to select all or invert the Checkbox instance. the Checkbox Processing Method in jquery and js will be different. Let's take a look at it. Use JS to select all checkpoints

Javascript Regular Expressions use variables

This article introduces some problems and solutions when using variables in Javascript Regular Expressions. It mainly describes the replacement and RegExp methods. Example 1: replace with a variable The replace function can be replaced by a regular

In the javascript pop-up layer, the WeChat scan instance is displayed.

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,

Common skills of iframe in Javascript (Adaptive/cross-origin)

Iframe is unfriendly to search engines. We may not find iframe content in Baidu, but iframe is commonly used. Let's take a look at some examples in js and iframe applications. Iframe is used by many websites. Although it is convenient for

Javascript-compatible copy of IE & FF to clipboard

The following shows how to copy the content to the clipboard in three JavaScript codes, which is compatible with various browser methods. One is JavaScript and the other is jquery. The other is the clipboardswf method. Method 1: Copy all js files to

Javascript multi-line news scrolling effect code

This article introduces you to a javascript multi-line news rolling effect code. The compatibility is not good, and the calling method is also very simple. Let's take a look at the example. The Code is as follows: Copy code

Sample Code for submitting form items using jquery ajax

This article introduces an example code of jquery ajax submitting form items. I hope this tutorial will be helpful to you. The Code is as follows: Copy code $ ("Form [name = 'createbox']"). submit (function (){Var self = this;

Total Pages: 472 1 .... 387 388 389 390 391 .... 472 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.