Defining a String Object
A JavaScript string object is used to work with text strings. The syntax for creating a String object is as follows:
Copy Code code as follows:
of the above three methods, only the first one is to
JavaScript Sub Method
The Sub method returns the subscript string defined using the HTML Sub Label property. The syntax is as follows:
Copy Code code as follows:
Str_object.sub ()
Tip: This method does not conform to the
JavaScript Concat Method
The Concat method joins two or more strings with the following syntax:
Copy Code code as follows:
Str_object.concat (str1, str2, ...)
Str_object is the first string (object) that needs to be connected, str1 is
Manipulating the parent window object in Modaldialog
1, can not use window.parent
Window.parent is used to operate in a frame and cannot be used to manipulate the parent Window object in a dialog box
2, the right way
Action by passing
This article refers to the Twoqueues caching model, which is to say that data is cached in memory.
In any language, you might want to put some data in memory, avoiding duplication and reading. The most common scenario is the jquery selector, where
One, DOM
Dom:dom= Document Object model, which enables the DOM to access and modify the content and structure of a document in a platform-and language-independent manner. In other words, this is a common way to represent and process an HTML or XML
A lot of things are easy to inadvertently forget, so I choose to record down.
Firefox does not support Obj.innertext properties.
The value shown by Obj.innertext alert () is undefined.
Firefox supports InnerHTML properties but does not support
Although many languages claim that "everything is an object", in JavaScript, not all values are objects.
Original Value vs ObjectThe values in JavaScript can be divided into two broad categories: raw values (primitive) and objects (object).
__PROTO__ is an internal prototype, prototype is a constructor prototype (constructor is actually a function)
The stereotype of a constructor (prototype) is an object
So what is a builder?To create an object, you first have an object constructor,
In some programming languages like C, each piece of code within the curly braces has its own scope, and the variables are invisible beyond the declaration of their code snippet, which we call block-level scopes, and no block-level scopes in
If you're an experienced developer, you might think this is a relatively simple problem, but sometimes we feel it's more interesting.
First, let's look at the definition of the array:"An array is just a list of values which can are accessed by
Object Creation:
When a function object is created, the function object produced by the functions constructor runs code similar to this:
Copy Code code as follows:
This.prototype={constructor:this};
Suppose function f
f
JavaScript when declaring variables, although the use of the VAR keyword declaration and no keyword declaration, many times the operation is not a problem, but the two ways there is a difference. Code that works correctly does not represent the
Basic concepts
javascript是一门解释型的语言,浏览器充当解释器。
Delay script
The defer attribute is defined in HTML4.0.1, and its purpose is to indicate that the script does not affect the construction of the page when it executes. That is, the script is deferred
Let's look at a piece of code first.
Function Show () {
alert (ABC);
}
var abc= "DEFG";
Show ();
People who have experience in C + + or Java programming may say, "This program is dead, and the variable is defined behind the function that
Usually we will be in some Web site registration page or change the Password page found that when we enter the password, there will be a bar similar to the progress bars to prompt the user to enter the password strength. The following figure:
I
Look at the results of the following examples to know the problem:
The implementation results of these three examples are:
Copy Code code as follows:
Results#region Results
No.1
0
Undefined
No.2
0
1
No.3
0
Undefined
Dodo previously in the group on the Online web page test screenshots of the site, then forgot to collect, the results in the chat records find a long time to find, first recorded here:
http://v03.browsershots.org/
Have time to write their own
3 ways to get function namesExample 1:
A way to see in the JS authoritative guide:
Function.prototype.getName = function () {return THIS.name | | This.tostring (). Match (/function\s* ([^ (]*) \ (/) [1]}
Example 2:
If the current function is a
False.tostring (); ' False '
[1, 2, 3].tostring ();//' 1,2,3 '
function Foo () {}
foo.bar = 1;
Foo.bar; 1
One oft-misunderstood thing is that numeric constants cannot be treated as objects, and numeric constants can still be treated as objects.
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