Http://hi.baidu.com/jiang_yy_jiang/item/95217544ea5a31e6bdf451ae
When you see this articleArticleI was wondering, why are you using this attribute? Probably a master? Haha! In other words, I caught a glimpse of the introduction of these attributes
Recently, I saw JavaScript quiz on perfection kill. Then,
I finally got two wrong questions (#2, #9). However, the two questions have different answers under IE and ff ?!
Attached test address: http://perfectionkills.com/javascript-quiz/
The
In a blog post I wrote a few days ago, I used JavaScript to dynamically create Dom element memos.
Write a method to dynamically add or delete elements, as follows:
Code highlighting produced by Actipro CodeHighlighter
Regular Expression ^ 1 [3 | 4 | 5 | 8] [0-9] \ D {4, 8} $
^ 1 indicates a Chinese mobile phone number starting with 1.[3 | 4 | 5 | 8] After 1, it can be a number of 3, 4, 5, or 8. If the phone number starting with 190 is displayed, the following
Rich JavaScript applications-the seven frameworks
A week ago, the throne of JS conference was held in Toronto. This should be the most expected and most different one I attended. The official website of the Conference said:
Load the entire
Function Base () {} base. Prototype = {X: 10 , Y: []} Function A () {} A. Prototype = New Base (); VaR A = New A (); A. Y. Push ( "First" ); A. x = 9 ; Console. Log (A. X); console. Log (A. Y ); Function B () {} B. Prototype =New Base ();
When a function is called, if a real parameter is omitted, the function automatically assigns a default value to the parameter, which greatly improves the convenience and flexibility of function calling.
For example, if the string truncation
// Basic foreach Function Foreach (array, Action ){ For ( VaR I = 0; I ) {Action (array [I]) ;}} // Test foreach Foreach (["Pear", "apple"], Function (Name) {console. Log (name );}); // ------------------------------------------------//
Three methods to convert a string to JSON format in javascript:JSON is often used in JS development. For example, in Ajax development projects, strings in JSON format are often returned to the front end and parsed into JSON objects at the front
Today saw a post, JS array usage {reproduced} http://www.blogjava.net/zks518/archive/2011/06/24/352948.html
Well written. I did it from start to end, push, Pop, shift, unshift, splice, slice, sort, and join.
DetailsCodeAs follows:
Go directlyCode:
Document. getelementbyclass =Function(N ){VaREl =[], _ El= Document. getelementsbytagname ('*');For(VaRI = 0; I ){If(_ El [I]. classname =N) {El [El. Length]=_ El [I] ;}}ReturnEl ;}
It is easy to use, for example:
VaRNick =
// Quick sorting Function Quicksort (SEQ ){ If (Seq. length> 1 ){ VaR K = seq [0]; VaR X = []; VaR Y = []; For ( VaR I = 1, Len = seq. length; I If (SEQ [I] X. Push (SEQ [I]);} Else {Y. Push (SEQ [I]);}}X = quicksort (X );Y = quicksort (y );
Essence:
A function is a class object.A function is a closure with a lexical scope.
2. Dynamic Objects Based on prototype inheritanceAn object has no category. You can assign a normal value to add a new member element to any object. An object
First, the person who asked this question was a genius. How could he have encountered such a problem. Secondly, the person who answers this question is a genius. I cannot imagine that he will answer this question. What is even more difficult to
Today, I encountered a problem. To implement paging through Ajax, we need to return the htmlCodeEnd re-assembly, one is paging, and the other is the query result. In this case, how can we separate the code at both ends? The method I came up with was
Douban JavaScript core style guideline
1. JavascriptCodeComply with Douban-jslint testing standards
1-1. The statement must end with a semicolon, except for, function, if, switch, try, while
1-2. Only long statements can be considered
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