1. Object Classification
There are three types of objects: local objects, built-in objects, and host objects.(1) local objectIt mainly includes object, function, array, String, Boolean, number, date, Regexp, and error. Example:
Array
In JavaScript, the named function can be called directly using the above method. An anonymous function can be called by referencing a variable, but how can an anonymous function be called without reference? The following example shows the three
In our daily applications, JavaScript is used most of the time, so many people have a view that Dom = JS is incorrect, but it can also explain the importance of Dom.
This leads us to consider the changes on the page of this method when writing Js.
Firefox works differently from IE when change SRC of A existing script, in IE this action cause the JavaScript engine to reload that script, and execute it, while in Firefox, nothing will happen
You can have your own test by following Code
When I was a beginner at JS, I knew about this function, but I never knew about its purpose. I always kept one eye closed and one eye closed. This time I will take a deeper look at the role of this function.
The function of Eval is actually very
I. Basics
1. Javascript Study Notes 1 -- Data Type
2. Javascript Study Notes 2 -- Functions
3. Javascript study Note 3 -- Scope
4. Javascript Study Notes 4 -- eval function
5. Javascript study notes 5-class and Object
6. Javascript Study Notes
If the project has a function, you need to submit multiple forms at a time. Therefore, the following table is displayed on the page:
Code:
...
For (I = 0; I Document. Form [I]. Submit ();
...
The problem arises. If the form does not contain ,
Complete exampleCodeAs follows: The following is a reference clip: untitled document qrasfdasfasfdasfsafasdfsafsafasdfasdfasd Add the code string to the page, and the search function is also available. For the demonstration effect, see the effect
The javascript pop-up layer fades in the background,CodeNot much. Adjust it based on your needs. Here we only implement the basic idea, and beautification is not very good. JavaScript pop-up layer, dimmed background a new layer is displayed.
In JavaScript study Note 5-class and object, I simply mentioned using JSON to construct an object.CodeAs follows:
ScriptType= "Text/JavaScript"> VaRPeople = {Name:"Kym", Age: 21, sayhello:Function() {Alert ("Hello, my name is"+This. Name +". I am"
First twoArticleDescribes constructor inheritance and prototype inheritance. Today, I have written the remaining two types of applications. These two types of applications have very few applications compared with the first two types. Therefore, they
Speaking of prototype, you have to first talk about the new process.
Let's take a look at this section.Code:
ScriptType= "Text/JavaScript">VaRPerson =Function(){};VaRP =NewPerson ();Script>
A very simple piece of code. Let's see what new
In the above article, I made an encapsulation of New using prototype principle, and then I thought, can I further encapsulate some basic features of object-oriented with prototype principle? For example, inheritance.
Well, let's build it step by
There are many inheritance in JS on the InternetArticleHere, I will write my own understanding of inheritance in Js.
Phase 1:
Function
A (){
This
. Funb
=
Function
(){Alert (
'
A: funb
'
);};}A. Prototype
=
{FUNA:
1.1.1 Summary
When learning JavaScript, we often encounter concepts such as scope and context. The execution context andThisKeyword is closely related.
If you have experience in Object-Oriented ProgrammingThisThe keyword is no longer familiar, so
1. variables are weak types.It can store any type of values. For example:VaR test = "hi ";Alert (TEST); // output "hi"Test = 55;Alert (TEST); // outputs "55"
2. Original Value and reference value.Variables can be stored in two types of values: the
Click () object. Click () enables the object to be clicked.Whether the closed object window has been closed; true/falseCleartimeout (object) clears the set setTimeout objectClearinterval (object) clears the set setinterval objectThe confirm ("prompt
We want to call JavaScript events in silverlight1.0. You can simply write the function name after the event, for example, loaded = sayhell, but it won't work in silverlight1.1, because a XAML file in silverlight1.1 corresponds to a C # file, and
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