Data Type: 1. Numeric (integer int floating point floating)
2. string type (string)
3. boolean (only two values: ture fasle)
String Literal 1. Escape series:Some symbols in Javascript cannot be identified. They are correctly displayed only after
A customer contacted me and said that the website I just created for him showed abnormal, and I was suddenly nervous. This was the first project I completed independently, so I quickly opened his website and looked at it, I didn't see anything
In fact, this should not be included in the scope of JS tutorials. It should be ff. IE6 and later browsers support the fixed attribute fixed. IE6 alone is not supported. So I tried to make ie6. Here is a tutorial. In addition, this effect can also
1. Matching mode flag:
G ------ indicates the global mode, instead of immediately ending when the first match is found to be successful.
I ------- indicates the case-insensitive mode.
M ----- indicates multi-row matching. The matching continues for
1. Get Elements
The getElementById () method is used to obtain the element id. If the element id does not exist, null is returned.Make sure that the name of the form element is not the same as the id of other elements. ie browsers under IE8 can use
1. Create an object
Copy codeThe Code is as follows: var person = new Object ();
Person. name = "RuiLiang ";
Person. age = 30;
Person. job = "Teacher ";
Person. sayName = function (){
Alert (this. name );
};
Person. sayName ();
2. Factory
1. URI Method
EncodeURI () and encodeURIComponent () encode the URIEncodeURI () does not encode special characters belonging to the URI, such as colons, forward slashes, hello, and well characters.EncodeURIComponent () Will encode any non-standard
1. How to run the delayed script:
Method 1: place all javascript references in the element. After the page content, as shown in figure
Copy codeThe Code is as follows:
Example 1
Method 2: Define the defer attribute defer =
Copy codeThe Code is as follows: function AutomateExcel (){
Try {
// Start Excel and get Application object.
Var oXL;
Try
{
OXL = new ActiveXObject ("Excel. Application ");
}
Catch (e)
{
Alert ("cannot start Excel! \ N if you are sure that Excel, "+"
Core code:
Copy codeThe Code is as follows: function quickSort (arr ){
// If the array has only one number, it will be returned directly;
If (arr. length Return arr;
}
// Locate the index value of the number in the middle. If it is a floating point,
First, let's look at the array classification:
Index Array and associated array by array subscriptCopy codeThe Code is as follows:/* index array, which is usually an array */Var ary1 = [1, 3, 5, 8];// Retrieve array elements by index, starting
Copy codeThe Code is as follows :/*
In the Basic JS syntax, there are several confusing points.
*/
/*
=
===
*/
Function de (){
Var AB = 25; // Value
Var ba = "25"; // string
If (AB = ba) {// =, it is converted first and then compared.
// Alert ("B ")
Copy codeThe Code is as follows: txt1.onkeydown = function (ev ){
Var oevent = ev | event;
If (oevent. ctrlKey & oevent. keyCode = 13 ){......}}
Txt1: the object bound to the event, for example, input in a text input box.
Oevent: event object (
In fact, the native JS also has these attributes. Similar to JQ, but less than JQ. However, it is a little more difficult to use than JQ. This is mainly because of the FF browser, because FF will treat your line feed as a DOM element. For
In JavaScript development, I was asked: What is the difference between null and undefined?
It is hard to answer at a time, especially undefined, because it involves the implementation principle of undefined. So, after thinking about it, write down
I. Closure in javascript
1. Let's first understand what is the function scope.
2. called object
Examples:Copy codeThe Code is as follows: function display (something){Function executeDisplay1 (){Document. write ("I am printing for the Boss:" +
1. Create a function
Since many functions have been used previously, I will not share them here.
2. nested FunctionsCopy codeThe Code is as follows: function china (){Function people () // nested function, which is used only by china{Document.
Question:
Copy codeThe Code is as follows: try {
Var me = Man ({fullname: "Xiaohong "});
Var she = new Man ({fullname: "Xiaohong "});
Console. group ();
Console.info ("My name is:" + me. attr ("fullname") + "\ n my gender is:" + me. attr ("gender "))
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