Subpage HTML:
CopyCode The Code is as follows:
Subpage JS:Copy codeThe Code is as follows: function createioc (text, value ){VaR o = Document. createelement ("");O. ID = value;O. href = "#";O. classname = "C ";O. style. Border = "2px solid red ";O.
Next I will give my personal opinion on how parallel operations will support front-end JavaScript.
1. Unlikely Evolution
Display thread supportIf the display thread is supported in Javascript, this may be a disaster. Currently, browsers parse
The three pages are separated into main.htm, left.htm, and right.htm in the same window.
Main.htm
Copy codeThe Code is as follows:
implementation across
Main Window
Left.htmCopy codeThe Code is as follows: left I am on the left
JQuery's use began to become the primary choice for javascript developers. However, without an overall plan, simple adoption will inevitably increase the maintenance cost in the future. A large number of jQuery plug-ins are like a double-edged sword,
[Document Object]This object is an attribute of the window and frames objects. It is a document displayed in a window or frame.
Attribute
AlinkColor activity link color (ALINK)Anchor is an HTMI anchor. It is created with the MARK (this attribute
1. What is a closure?
The "official" explanation is: the so-called "closure" refers to an expression (usually a function) with many variables and an environment bound to these variables ), therefore, these variables are part of the expression.
I
Global variables are part of the properties of the Window object. For example:
Copy codeThe Code is as follows: var test = 'test ';
Alert (window. test );
The general sequence of browser rendering and HTML operations:HTML parsing completedExternal
Copy codeThe Code is as follows: function xntest (){
Var d1 = new Date ();
Var str = "";
For (var I = 0; I Str + = "stext ";
}
Var d2 = new Date ();
Document. write ("Time consumed by String concatenation:" + (d2.getTime ()-d1.getTime () +
Method 1: recommended code
Copy codeThe Code is as follows:
Method 2:Of course, we can get the parameter value in the background, and then get the variable value in the front-end js Code. For details, refer to my article: javaScript obtains the C #
Here, I choose to convert xml directly to json for subsequent processing of javascript applications. I used the. net platform to build a simple webservice.
Request. asmx
Copy codeThe Code is as follows: using System;
Using System. IO;
Using System.
1. Confused! Doubts caused by a piece of codeSee the following code:
Copy codeThe Code is as follows: for (var I = 0; I Console. log (j + "," + k );
For (var j = 0; j Var k = j + 1;
}
}
Console. log (I );
Output result:Undefined, undefined3, 33,
I. Javascript variable DeclarationDeclare a variable in Javascript
Var a = 1;
Or directly
A = 1;
The two expressions are different,
One is the local variable of the current scope, and the other is the global variable of the current scope;
The
Common regular expressions are as follows:
Copy codeThe Code is as follows: "^ -? [1-9] \ d * $ ", // integer
"^ [1-9] \ d * $", // positive integer
"^-[1-9] \ d * $", // negative integer
"^ ([+-]?) \ D *\\.? \ D + $ ", // number
"^ [1-9] \ d * | 0 $
Copy codeThe Code is as follows: var picarry = {};
Var lnkarry = {};
Var ttlarry = {};
Function FixCode (str ){
Return str. replace ("'", "= ");
}
Var t = document. getElementById ("pictable ");
Var rl = t. rows. length;
Var baseu = document. URL.
1. js Regular Expression (RegExp object)
The RegExp object has three methods: test (), exec (), and compile ().
① Test () method
// The test () method retrieves the specified value in the string. The return value is true or false.
Var patt1 =
1.
// Use the attributes of Variables
2.// Convert all letters in the string into uppercase letters.
3.// Add hyperlinks to variables in js
4.// IndexOf method (locate the first occurrence of a specified character in a string. If-1 is not found,
Document directory
The definition list can also be changed to a tree:
If anyone is interested, they can change it to dynamic loading data, or use jquery, and the code will certainly be much less! I found that adding some css makes this tree
JavaScript Inheritance
DouglasCrockfordWww.crockford.com
And you think you're so clever and classless and free-- John Lennon
JavaScript is an object-oriented language without classes. It uses prototype inheritance to replace class inheritance. This
Tip. js
Copy codeThe Code is as follows: function tips (obj, tag ){
Var tip = document. createElement ('div '), arg = arguments [2], left, top; // create tipbox
Var bodywid = document.doc umentElement. clientWidth; // You can also replace it with
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