This article is divided into three parts
Some typical problems of JS digital precision loss
The reason for the loss of JS digital precision
Solution (one object + one function)
First, JS digital precision loss of some typical
Recently encountered a very interesting problem in the work. The object for JS is sorted by key value. such as the following Obj objectvar obj ={"China": "' Beijing ', ' Sichuan ', ' Jilin '","British Great Britain (2)": "' London ', ' Airland
Today, when processing data, the foreground interface amount needs to retain two decimal places, so only JavaScript can be used for interception.var regex =/([0-9]+\.[ 0-9]{2}) [0-9]*/;var Localmoney = 6002.3310;Localmoney = localmoney.tostring ().
__proto__ of all constructors/functions point to Function.prototype, which is an empty function
123456789
Number.__proto__ === Function.prototype // trueBoolean.__proto__ === Function.prototype // trueString.__proto__ ===
AMD is the abbreviation for "Asynchronous module definition", meaning "async module definition".Module definitionDefine (ID?, dependencies, Factory);which
ID: module identification, can be omitted.
Dependencies: The dependent module can
The previous two articles describe two important properties in the JavaScript execution context: Vo/ao and scope chain. This article looks at the this in the execution context.First take a look at the following two summary of this:
This is
Method One:An extension to date that converts date to a string of the specified formatThe month (m), Day (d), hour (h), Minute (m), second (s), quarter (q) can be used with 1-2 placeholders,Year (y) can use 1-4 placeholders, milliseconds (S) with
Copyright belongs to the author.Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.Van HongchunLinks: http://zhuanlan.zhihu.com/FrontendMagazine/19850058Source: KnowThe next generation of
/* * to traverse all property names and values of the specified object * _list the object to traverse * * function All_pro (_list) { //To hold all property names and values var pro = ""; Start traversing for (var i in _list) {
Because of the differences between various browsers on the market and the "quirks" of different browsers, we may need client-side detection during development to ensure that our code runs smoothly across all browsersThe first of the most commonly
The problem with the keyword in JavaScript, the name is replaced, there is no problem. Now paste its keywords and reserved words to make it easier to see and avoid similar problems at a later time.1 Key
JavaScript Learning Cookie ObjectJavaScript CookiesCookie object:A cookie is a user data information (cookie data) that is stored in a cookie folder in the client's hard disk as a file.The cookie file is established by the Web site visited to hold
Bootstrap _ form _ Form Control and bootstrap Form Control
I. input box
Single-line input box, a common text input box, that is, the type attribute value of input is text.
When using input in Bootstrap, the type must also be added. If the type is
JavaScript retrieves information icons of various browsers, and javascript retrieves icons
How to obtain browser Information
Window has a navigator object to let us know all the information about the browser. We can use a series of API functions to
The pseudo-Paging effect Code implemented by jquery.
This example describes the pseudo-Paging effect Code implemented by jquery. We will share this with you for your reference. The details are as follows:
The jquery pseudo-Paging effect introduced
The instance explains the website front-end interface development process, and the instance explains the front-end
The website front-end interface is the front of the website, so it is very important to design this interface! In fact, the front-end
JavaScript code for zooming IE status bar text and JS Status Bar
This article describes the code for JavaScript to implement the text zoom effect on the IE status bar. We will share this with you for your reference. The details are as follows:
Here
Front-end project structure design fine-grained solution, front-end project Structure Design
At the beginning, the front-end project is very simple, html is put out, and then a new css and js folder is created, which looks very clear.
As time went
Use the sublime snippet function to quickly create a code segment.
In front-end development, we often enter the same basic code, such as common jquery references, bootstrap frameworks, and cssreset. If you copy and paste the code at each time, here
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.