one of the most important best practices in Web performance optimization is reducing HTTP requests. The most important way to reduce HTTP requests is to merge and compress JavaScript and CSS files. When writing CSS, we should pay attention to some details to control the size of the CSS file, such as: Global style, inheritance style, abbreviation style, space, comments, etc., you can also use the online tool to compress your CSS file to reduce the size of the CSS file, but the compressed CSS file
Objective:The function is divided into a parameter with a return value, a parameter has no return value, no parameter has no return value, and no parameter has a return value; So what about the function you want to use without parameters? What if you want to encapsulate a code that implements a variety of functions, but the parameters are larger than the arguments or the arguments are larger than the formal parameters? In this paper, some related operations about parameters, such as value passin
ObjectiveHere is a record of their own reading you don ' t know JS series of some experience, but also JavaScript a summary of their knowledge of it. High-Energy warning: the article is longer and trivial, please bring your own bench melon seeds ~Types (Type)
Variables don ' t has types, but the values of them do.
The meaning of this sentence is: there is no type of variable, the value stored
Recently in writing a small JS, think of n times, also changed n times, later do not know why, the effect on the realization, and then re-read the code, exclaimed: This is the original.So do you think this code is written by yourself?I think so, and I think it's not.The reason: The program itself is through their own continuous and slowly groping, from the wrong to come out;Not the reason: The program was n
/loop Loop statement = + block (statement block) + Scope We often need to group a series of statements together and which we often call a block.{ = a. = Amount; Console.log (amount);}This kind of standalone {:} general block was valid but was not commonly seen in Js programs. Typically, blocks is attached to some and other control statement, such as an if statement or a loop.ClosureYou can think of closure as a by-remember and continue to a
The case address is www. cndf. comorderprice. php. First, I want to know how to calculate the price automatically using several options. By viewing the html, I learned that the {code...} role of this js file, I tested, the source site offline is unable to calculate the results,... case address http://www.cndf.com/order/price.php
First, I want to know how to calc
internet giants, including Facebook, Google and Twitter, have adopted the same technology as meteor in Web applications, the meteor team said. (Project details)
Project home: http://meteor.com
Code Escrow Address: Https://github.com/meteor/meteor
Jqueryjquery is another excellent JavaScript framework following prototype. It makes it easy to manipulate document objects, handle events, animate, use Ajax to interact with websites, and more. Provides APIs that can be used
CSS3 Transition attribute transition, at the end of the animation, there is also an end event: webkittransitionend;Note: Transition, there is only one event.Http://www.runoob.com/jsref/event-transitionend.htmlVuejs Code Snippet:SetTimeout (() = { This. Wrap.classList.add ('swipe-transition'); This. Swipemove (- This. Index * This. PageWidth); Once ( This. Wrap,'Webkittransitionend', _ + = { This. Wrap.classList.remove ('swipe-transition'); //code for Li Chian-hung notes//this.
Tip 1: Use El.contains (e) To determine the area of the clickTip 2: Use MouseUpTip 3: When you are done, remove the eventShowpopover (e) { This. PopOver =! This. PopOvervarClosepopover = (Event) = { if(! This. $refs. PopOver.contains(Event. Target)) { This. PopOver =falseDocument.body.removeEventListener ('MouseUp', Closepopover)} } document.body.addEventListener ('MouseUp', Closepopover)} Warm know new
In JS, the syntax for creating a function object is var myFunction = new Function (arg1,..., agrn, body);where the n parameters of the function object are placed in front of the body of the function body parameter, that is, the function body parameter must be placed at the end of the parameter list, or there can be no parameter new function (body).If you add a third parameter to the last, then "alert (x+= ' aasf ')" will be passed into Func as a param
Object inheritance Inherit
var o = {r:};
var c = function f () {
};
C.prototype = O;
C.R =;
Alert (O.R)//The inherited property value has not changed.alert (C.R);//c in R overwrites the properties in O.
How do I call the R property in O?
var o = {r:};
var c = function f () {
};
C.prototype = O;
Alert (O.R)//The inherited property value has not changed.
alert (C.R);//Query R property, return undefined value.
Calls should be made using prototypes.
The above is a small set to intr
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.