Some Notes on js object-oriented programming. In js, object-oriented programming is a bit like java or c ++. Below I will give you some notes on js object-oriented programming, I hope it will help you.
Many background languages, such as c ++, java,
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
I have seen a foreign user using console. table () to debug javascript code. I feel this is very good. Next I will introduce you to using console. table () to debug javascript instances.
Maybe you are used to console. log () to debug js, very easy
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
The countdown is simply to use js new date () to create the Jane time, and then use settimeout to regularly update the number in the div, next I will introduce the example of a countdown code based on this principle.
A few days ago, the boss said he
In js, The addEventListener and attachEvent functions are used for event listening. In jquery, the $ (# id) function is almost the same. Next we will see that an event listening function supports anonymous functions, I hope to help you.
There are a
A good javascript code can be used to obtain the instance code from a few days ago and a few days later.
The Code is as follows:
Copy code
// Return the date () based on the time chou function );Function getLocalTime (ns
The difference between the string length calculation function is that numbers are recorded as 1 in English and Chinese as 2. This function is suitable for computer character encoding principles. See some examples below.
You will use CSS to control
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'
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
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
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:
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
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
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
Excel files are frequently encountered in the office. In addition to using php to generate excel files, we can also use js to export page tables into excel files, we sorted out some examples for you to come and have a look.
In a recent project, you
In javascript, the array length is very simple. You can use the length function to obtain the specific array length. However, when using the group length traversal function, it should be length-1 and the starting value is 0.
Array length:
You do not
This article will introduce the interaction between ajax and json data. In the past, ajax post, get, AND htm and txt data were directly returned. This is a try to return json data.
In your own background cms, you want to use the pop-up mask layer on
In jquery, we can directly use $. post or $. ajax to submit a form. The following section describes the ajax submission form instance.
This is the simplest way.
The Code is as follows:
Copy code
$. Post ("/index. php?
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;
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