To fully understand and master JavaScript, the key lies in figuring out its nature, history, and limitations.
A Brief History of javascript: in 1992, nombas (later acquired by openwava) developed an embedded scripting language named C-minus (CMM)
Arguments Object
In the FunctionCodeUsing special object arguments, developerParameter names do not need to be explicitly specifiedTo access them.
For example, in the sayhi () function, the first parameter is message. You can also access this
It is not used. It is hard to find. More data will be collected in the future. Easy to use later1. Replace one character in a string with another character.Replace (/\ */g, '/') // replace \/
IP address matching regular expression: "^ (\ D {1} |
Private methods also exist in JS, which can be called only by yourself.
Private methods are written in the object's constructor for implementation.
Instance:
Function user (name)
{
This. Name = Name;
Function display ()
{
Return this. Name;
Closure is a difficult and characteristic of JavaScript language. Many advanced applications rely on closures for implementation.
I. Scope of Variables To understand closures, you must first understand the special variable scopes of JavaScript.
1. the browser is not a software window. It is very difficult to identify the event because closing and refreshing events are difficult to distinguish.2. There are no corresponding events, which can only be determined based on certain conditions,
1.doc ument. Write (""); is the output statement 2. Comments in JS are // 3. The traditional HTML document sequence is: Document-> HTML-> (Head, body) 4. the DOM sequence in a browser window is: window-> (navigator, screen, history, location,
1, Java When the script parser is started, it will initialize and create a global object, which has some predefined global variables and global methods, such as Infinity, parseint, math, all Program The global variables defined in are the attributes
1. Encoding Functions
1) encodeuri
Returns the encoded result of a URI string. URL is the most common Uri;
2) decodeuri
Decodes an encoded URI string into the original string;
3) Example: Eg.
Output result:
Encodestr:
DetailsCode:
Alert (cmycurd (10050 ));
Function cmycurd (Num) {// convert it to the capital amount of RMBVaR str1 = '0-9 Chinese CharactersVaR str2 = 'tens of thousands of characters, hundreds of millions of characters, tens of thousands of
Reference address: http://www.klstudio.com/post/90.html
Javascript implements password strength detection and provides a simple method.
HtmlCodeAs follows:
Html
>
Head
>
Title
>
Passwordstrength
Title
>
First of all, you must be familiar with Yahoo!'s original http://developer.yahoo.com/performance/rules.htmlenglish edition. It is very detailed. Of course, you can also go to so.
The following are some notes for the technology sharing conference:
1. the array subscript must be a non-negative integer. Otherwise, JavaScript will convert it into a string as the name of the object attribute, instead of defining a new array subscript.
2. adding a new element to the array does not necessarily
Unobtrusive Scripting)
A non-invasive script should include all the following features:
1. It should be available. That is, it brings clear availability benefits to the website.
2. It should be accessible. That is to say, if Javascript becomes
If you do not know the quirksmode of the PPK website, it means that you have not become a senior JavascriptProgramMember. Over the years, PPK has made unremitting efforts to help countless web developers around the world. Today, he has concentrated
What is event proxy? Meaning and Principle
Using events to proxy JavaScript events is the foundation of interaction among all webpages (I mean real interaction, not just those CSS drop-down menus ).
In traditional event processing, you add
1. "|" operator if | the first parameter of the operator is true, or a value that can be converted to trued, the operator returns its first parameter. Otherwise, the second parameter is returned. For example, a = A | []; if a has been defined and is
People who often use JavaScript will think about its garbage collection mechanism. JavaScript does not require developers to manually clear garbage like C and C ++.ProgramYes. Developers do not need to worry about memory usage issues. The memory
The following describes how to do this by naming the three pages as framedemo.html, top.html, and button.html.
In this example, framedemo.html consists of two pages,CodeAs follows:
framedemo
Now, let's set the
After the project is developed, you need to create a CD cover for navigation and multiple languages. to navigate to the. net FrameWork, you only need to develop an interface using JavaScript. The Code is as follows:
MINIMIZEBUTTON = "no" CAPTION =
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