When we were kids, we played jigsaw puzzles with our own hands. Today we're going to study the puzzle with JavaScript. The same puzzle, but with the JS puzzle than the hand puzzle more trouble, so later I want to optimize it into the engine.
First,
Recent customer requests to use JavaScript to implement video carousel:
Interested students can participate in the Open
The following write a program to achieve video carousel, PC end and mobile end can be realized,
But the mobile side, there is
This is just a simple JavaScript and HTML5 applet, did not realize the Man-machine battle.
A two-dimensional array of gobang checkerboard drop points. The elements of the array correspond to drop points. For example, an array element value of 0
Google Map V3 JavaScript calculates the distance between two marker
To do map development, the most commonly used is to marker some operations and interaction. Briefly, the distance between two marker is calculated.
Google Map API is very convenient
"ParentNode"
Used to get the parent node of an element. To understand parentnodes as a container with a child node in the container
Cases:my text
In the above code, you see "Dad" as a div container, the container has a "child", is the bold text
Lately it's been tangled up with JavaScript.
A problem with this is that the character set of the database is UTF-8, and you want to use JavaScript on the page to verify that the text you enter uses UTF-8 storage to occupy the byte length. The
JavaScript intercept string (supports mixed in Chinese and English)
Copy Code code as follows:
Using JS method substring ()
Copy Code code as follows:
var str = "0123456789";
Alert (str.substring (0));------
If I ask you 0.1 + 0.2 equals how many? You may send me a supercilious eye, 0.1 + 0.2 = 0.3 Ah, that still ask? Even the kindergarten children will answer such a childish question. But you know, the same problem is in the programming language, maybe
First, with JS calculation12.32 * 7 How much is the result? Answer: 86.24000000000001
Why is there such a problem? How to solve?JS in processing decimal multiplication and division of the time there is a bug, the solution can be: The decimal into
HTML code:
Copy Code code as follows:
page title
javascript Base64 Encode & Decodeveinyf@gmail.com2014-12-27 17:44
Base64
convert done!
Effect:
It is better to recommend a JavaScript IDE than Aptana.
In this paper, we describe the method of random shuffling of JavaScript array to realize random shuffle function. Share to everyone for your reference. The specific analysis is as follows:
This JS code can be in the array of elements of random
The examples in this article describe the way JavaScript outputs the current time Unix timestamp. Share to everyone for your reference. Specifically as follows:
The following code is put back through the gettime () of the Date object to the Unix
In JS used in the array, such as multiple names of the same () input, if the dynamic generation (of), the submission of the need to determine whether it is an array. if (document.mylist.length!= "undefined") {} This usage is incorrect.Correct () is
The data types of JavaScript are divided into two categories: original type and object type. 5 Original types: Number, String, Boolean, null (empty), undefined (undefined). An object is a collection of attributes, each of which is made up of
Nativescript is an open source framework that uses JavaScript language to build Cross-platform native mobile applications, supporting iOS, Android, and Windows Phone. And the use of Nativescript does not require much complexity, just use the
The examples in this article describe JavaScript-functional programming. Share to everyone for your reference. The specific analysis is as follows:
JS, like other dynamic languages, can write higher-order functions, and so-called higher-order
Look at this line of code first:
It's kind of ... It's not good. "Where should I put it?" "Developers would be surprised," put the dots on the tag. Or is it down to the label? "Both of these practices will make the rich script site
What is strategy? For example, we want to go to a place to travel, can be based on the actual situation to choose the route of travel.1, the definition of the policy model
If you don't have time but don't care about money, you can choose to take a
This article gives you an example of JavaScript closures, prototypes, and anonymous functions, see below for specific details.
A .> about closures
Understand the knowledge that closures need
1. Scope of variables
Example 1:
var n = 99;
The Evolution of asynchronous JavaScript combs the development of JavaScript asynchronous functions, first through the callback function, and then through the promise/a+, generator function, And the future will be the async function. Thank Jingzhung
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.