Copy Code code as follows:
(function ($) {
(function ($) {
$.preload = function (data, CFG) {
return new Loader (data, CFG);
};
var maps = {}, on = $.event.add, un = $.event.remove, head = document.getElementsByTagName ("head") [0], BODY =
The function code is as follows:
Copy Code code as follows:
/*
* Arithmetic precision correction function
* M value 1 (number)
* N value 2 (number)
* OP operator (string)
*/
function Fixmath (M, N, op) {
var a = (m+ "");
Body
The concept of closures:
A closure is an expression (usually a function) that has many variables and an environment that binds them, and therefore these variables are also part of the expression.
The most common closures
Copy Code
Business:
The flexibility of 1.1 JavaScript
Object-oriented JavaScript programming mode: 1, you can save the state 2, with the object to call the method 3, the written program to master its structure, can withstand the iterative development
Copy Code code as follows:
var info= "Tencent Pat Net (www.paipai.com) is Tencent's well-known E-commerce website. ";
Info + + "Pat NET launched on September 12, 2005,";
Info + + "March 13, 2006 announced the official operation,";
The code is still simple. So there's still nothing to explain.
Copy Code code as follows:
/** Koverload
An auxiliary method for creating overloaded functions.
Complements the last function.
@Author Ake 2010-07-03
@weblog
implementation of event capture (incident Capture)
In the event model specification of the LEVEL2 DOM, events in the DOM tree propagate (from the root node to the target node) are divided into two phases: Capture (Capture) and bubbling (bubbling).
Returns true if the page is in the focus state, otherwise Fasle
What is the focus? The focus refers to whether the user is active on the page. Exactly whether the mouse is active within the page. or whether the contents of the page are selected, or
There were three ways to consider:
1. Directly write the path in the JS file, but if the reference page path level changes can not.
2. Write a class, put the CSS file in the subject package or create a separate CSS file for the date control. However,
You can see this in some JavaScript libraries:
Copy Code code as follows:
(function () {
All library Code Code
})();
To tell the truth, for JS beginners for me. This thing is so scary, in these JS libraries, this function
1. First we'll look at a few concepts, "events", "Event Flows", "Event names", "event handler functions/Event listener functions, perhaps" cliché ", and know friends can be crossed.
Event: An event is a specific behavior by the user itself or by a
Here, using native JavaScript, create an object-oriented way to easily maintain the easy to use sliding menu, called the following way:
Copy Code code as follows:
var $sliding = document.getElementById ("silding");
var S1 = new
So on the original basis of the change, packaged up, and do a further optimization, so that the same page can use a number of such effects, xhtm and CSS unchanged, interested friends can be in JS above can be compared with the previous code, so
Previous JavaScript support for IO was weak and could not be written to the corresponding text file, and the exception object error was not uniform and could not print the detailed stack. Customizing the exception object is a very flattering method
Later, a technical group asked the following code:
Copy Code code as follows:
function Html2node (s) {
var d = document.createelement (' div ');
d.innerhtml = s;
if (d.childnodes.length = 1)
return d.childnodes[0];
var df =
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