This article mainly introduces an AJAX function encapsulated by native Javascript. It is extracted from actual projects and is easy to use, for more information about ajax operations, see the recent work. currently, the ajax function is encapsulated
Replace
Interpolate|Sub|Scan|Truncate | gsub
Interpolate: regards a string as a template and fills it with the object attributes.
Sub: replacement is used to replace the substring specified before the string that matches the pattern
This article mainly introduces the use of Array in JS. For more information, see new Array ()
New Array (len)
New Array ([item0, [item1, [item2,...]
Method to use an array object:
Var objArray = new Array ();
ObjArray. concact ([item1 [, item2 [,...]
Many articles about the differences between the substr, substring, and slice methods have been found online, and the content is basically the same. Then, I moved the code in one of the articles to a local machine for testing and found that the test
Original articles, reproduced please specify the source, thank you!/* * The Tokenize function is the core function of the selector resolution, which converts the selector to a two-level array groups * Example: * If the selector is "Div.class,span",
In js, cookie operations are related to the storage and clearing time. We only need to set the cookie expiration time to control its storage, below I will summarize some tips for using cookies in js.
Create and store cookies
In this example, we will
Cookies are commonly used in WEB development. They can be used not only in js, but also in php. Next I will introduce a cookie operation class to read cookies, delete operation.
Compared with javascript, it is easier to use backend php to operate
This article mainly introduces the information about random sorting of arrays in the JavaScript study notes. For more information, see
Recommended reading:Array Summation Method for JavaScript learning notes
Add, delete, modify, and query the array
The addition and deletion of js array elements have been confusing. Today, I finally found detailed information and gave me the code to test. ^-^
The addition and deletion of js array elements have been confusing. Today, I finally found detailed
Today teaches us a cool code, glittering map of China. Just need to use vue+vuex+axios+echarts to make this map dynamic update, let's take a look.
I. Build the project and install the plugin
# installation VUE-CLINPM Install vue-cli-g# Initialize
This article mainly introduces the code example of adding and deleting methods to and from JS array elements. This article provides an example of operating code directly, if you want to add or delete the js array elements, you will be confused.
A non-empty zero-indexed array a consisting of N integers is given.A triplet (X, Y, Z), such that 0≤x double slice.The sum of double slice (X, Y, Z) is the total of A[x + 1] + a[x + 2] + ... + a[y−1] + a[y + 1] + A[y + 2] +. . + a[z−1].For example,
First in this article:
The first attempt to translate, original from codeproject (http://www.codeproject.com/jscript/Observer_Pattern_JS.asp)
The first time I used Windows Live writer, beta version.
The first time I wrote in my blog:
The judgment of input content, the judgment of the source of the event object and the use of the mathematical operations "+,-, *," can be learned by interested friends.
Knowledge point:
1. Use of mathematical operations "+ ,-, *,/"
2. input content
Learning golang language (1): Hello World
Learning golang language (2): Variable
Learning golang language (3): Type-Boolean and numerical type
Learning golang language (4): Type-string
Learning golang language (5): Type-array
Learning golang
I. array. Slice (START, end) method:
Slice () is used to take part of an array and use it to copy the array. If the end parameter is omitted, the split array contains all elements starting from start to the end of the array.
Use it to copy the
From the worry-free script collection, some are indeed good, more practical, it is worth collecting.
How to extend the prototype object of Array
Copy codeThe Code is as follows: // Delete the data in the array
Array. prototype. del = function (n)
{
Eq (index) obtains the position of the nth element from 0.
Reduce the set of matched elements to a single element. The position of the element in the set of matched elements starts at 0 and goes to length-1. Return
Replace
Interpolate | sub | scan | truncate | gsub
Interpolate: regards a string as a template and fills it with the object attributes.Sub: replacement is used to replace the substring specified before the string that matches the pattern
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.