A good program is not written to computer, but to human. Encounter complex functions, you should think of it simplified, modular, small functions packaged into groups, small function blocks can be arbitrary combination of the ever-changing complex
Looking at the JSON (JavaScript Object notation) object, JSON is a data Interchange Format object commonly used in scripting operations, and JSON is a lightweight format relative to XML. In some intelligence Ides, you can also easily manipulate the
9, Yui writing class way
Here is the introduction of Yui 2.7.0 version, just introduce Yahoo.js. Yui introduced a namespace, similar to the Java package. The following Yahoo Tools function pack
Yahoo.namespace
Yahoo.lang
--The preface--
The alert and confirm standard methods for window objects do not display the same in different browsers, and there is a common point that is not very attractive. Our idea is to use JS and CSS to imitate them, to provide another set
IE is not very good, in IE setattribute only to recognize some static properties, and like the onclick event is invalid, to use the Attchevent method
Untitled document
[Ctrl + A All SELECT Note: If the need to introduce
Sometimes in the development process, we will find that the interface required by the client and the interface is incompatible with the problem. We cannot modify the client interface for special reasons. In this case, we need to fit the existing
Introduction
A closure is a function that has access to a variable in another function scope.Closures are hard to understand in JavaScript, and many advanced applications rely on closures, so let's take a look at one of the following examples:
We can customize events to achieve more flexible development, and events can be a powerful tool, and event-based development has many advantages (described later).
Functions with custom events are event, Customevent, and dispatchevent.
To
JavaScript is a scripting language that can be run in a browser, a weak language (as opposed to C,c#,java), where a conditional judgment is used as long as it is a computer language, and JavaScript, as a "weak" language, is often puzzled by its
In JS, these three are used to change the function of this object to point to, they have what kind of difference.
Before you say the difference, let's summarize the similarities between the three:
1, are used to change the function of this object
The two days after reading the Zhang Xiaoxiang: javascript--html part, the focus of the HTML is summarized.
In reading the two chapters of HTML will not need to delve into, some are dynamic only used, and some are outdated (used and grammar of the
Don't say much, please see the specific implementation code
There ' is ' in the string ' is ': ' The Var str= ' is ' is '
;
var substr=new RegExp (' is ');//Create Regular Expression object
var result=str.replace (subStr, "");//replace ' is '
Words do not say, following the small series together to see the example code bar
Js:
/** * Author:black_jay Astrid * Downcount: Time Conversion Countdown * * (function ($) {$.fn.downcount = function (options, callback) {
var settings =
Now let's talk about the use of regular expressions with the "G" tag, and first we'll look at a piece of code that's easier to understand from an example.
Copy Code code as follows:
1 function A (val)
2 {
3 var re =/^\d+$/g;
4
Regular expression: syntax:/expression/, slash indicates starting positionHow to create:
1, var regobj = new RegExp ("pattern", [, "flags"]);Pattern: Required option, regular expression string;Flags: Optional, some combinations of flags.2, var
What is arguments?
Arguments is a similar array that is created when a function is called, but is not an array object, and it stores the arguments that are actually passed to the function, and is not limited to the argument list of the function
Array.prototype.lastIndexOf and String.prototype.lastIndexOf are very useful methods, but many people do not know that it can actually pass two parameters, and the second parameter determines the starting position of the search:
Grammar
Str.
What does the syntax mean (function () {}) ()
The following example:
Reference
How does that explain this?
You should remember that.
var a=function () {}
So how do you run a?
So that's a ()
Same reason.
We don't save it through a variable.
It
null and undefinedundefined is equivalent to a variable and does not have an explicit assignment (whether it is assigned, may inadvertently ignore, logical problems) JS's weird is that undefined is really a can use the value.
> var foo;
>
Today we will learn a useful and interesting content: Cookies-This is used to record the information of the person who visited your Web page. Using cookies, you can record the visitor's name and send a warm welcome message when the visitor visits
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