Some knowledge at that time really did not understand words, can put aside, stay in later to see perhaps can understand.
A few months ago, holding the "JavaScript Advanced Program Design (third edition)", after chewing the creation of objects,
I. Scope of functions
1. Function scopes
Is that the scope is in a "function" where all variables belonging to this function can be used and reused throughout the function.
function foo (a) {
var b = 2;
function Bar () {
//...
}
var c = 3;
It's classname, not class.
Note that JavaScript uses classname to access the class attribute because class is a reserved keyword, because in the future JavaScript might begin to support classes like Java.
When we discussed the style attribute, we
Interested friends Search "Baidu popup" is good, has been given a note, strong.
The most interesting thing is to use JavaScript to get and set style
The DOM Standard introduces the concept of overriding stylesheets when we use
function Test () {
This.name= ' Test ';
var name=2;
This.show=function () {
alert (name);
alert (this.name);//Display Name
}
}
var test=new test ();//Create an object from the constructor
Test.show ()//Output 2 and ' Test ', stating that the object
1. Will completely screen the right mouse button
oncontextmenu= "Window.event.returnvalue=false"
2. Deselect, prevent replication
3.JS not allowed to paste
4. js to prevent replication
5.
The test code included in the book is as follows
Copy Code code as follows:
Example
Note: the latest versions of Firefox seem to have fixed the string concatenation Pro Blem. If you are using Firefox 1.0 or later, the string
What is "clone"?
In the actual programming process, we often encounter this situation: there is an object A, in a moment a has already included some valid values, you may need one and a exactly the same new object B, and any subsequent changes to B
combination mode: combine a group of objects into a tree structure, and treat grouped objects and leaf objects uniformly, ignoring the differences between them (because leaf objects can also contain leaf objects and become composite objects),
JavaScript in the closure is really a cliché of the problem, the recent interview has been asked, my own ability to express and can not fully support, really crazy. On the way back, I suddenly thought of a very simple thing, in fact, we are doing
Before object.is, we compare values using the two equal sign "= =" or the three equal sign "= =", the three equals is more rigorous, as long as the comparison of the two types of different immediately return false.
In addition, there is and only
In web programming, it is important to identify the user's browser and operating system. Because they have different levels of support for HTML and JavaScript.
General application in the System landing page or the homepage.
The specific application
You can use the following functions when you need to Cheng a fixed length in front or behind when outputting integers.
Copy Code code as follows:
function PadLeft (str,lenght) {
if (str.length >= lenght)
return str;
Else
1 Creating
var xlobj = new ActiveXObject ("Excel.Application");
var xlbook = XLObj.Workbooks.Add; New Workbook
var excelsheet = xlbook.worksheets (1); Create a worksheet
2. Save the form
Excelsheet.saveas ("C:\\test.") XLS ");
3. Make Excel
Objective
BMI index (Body Mass index), is a standard commonly used internationally to measure the level of weight and fitness of the human body, and when we need to compare and analyze the health effects of a person's weight on people of different
Usually encounter the problem of tree structure, such as the display directory structure.
In most cases, the background returns such data as follows:
[
{id:19, pid:0, Name: ' Nodejs '},
{id:20, pid:19, Name: ' Express '},
{id:21, pid:19,
No1. Grammar and type 1. Declaration definition Variable type: var, define variable; Let, define block domain (scope) local variable; const, define read-only constants.Variable format: Starts with a letter, an underscore "_", or a $ symbol, which
Scope of a variable
To understand closures, you must first understand JavaScript's special variable scope.
The scope of a variable is nothing more than two kinds: global and local variables.
The special point of the JavaScript language is that
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