Using the email Method
//
email
Window. Location. href
=
"
Mailto: talantlee@126.com
"
;Myform. Action
=
"
Mailto: talantlee@126.com
"
;
Another email can provide some functions and can be used directly.1> mailto: study@126.cn,
The setTimeout function is used for delayed execution. Good at using this function can reduce a lot of Ajax requests and Dom operations.
1. Delay switching tab
Requirement: There are several tabs on the page. When you switch to a tab, the data in
Function myFunction (test1, test2 ){// Parameters passed in with apply must be explicitly declared and retrieved in the put order// Alert (extendStr );Alert (test1 );Alert (test2 );// After binding the property, you can call the function without
Implement javascript running in innerHTML, so that each module of the page can interact better and share data.
After referring to some previous practices, we adopted some workarounds and added some additional tags to better implement javascript
The proportion of images displayed on the Web is usually incorrect. If you do not limit the width and height for , the entire page will be congested if the picture is too large, if the image is small, the image will be distorted.
My requirements are
For example, if you want the five functions ABCDE to be executed in sequence, you can write the following code.
A();B();C();D();E();
In the case of synchronization, such code has no problems. However, if ABCDE is asynchronous, it
In this log, the constructor is mentioned in the method of defining functions in javascript. Now, we will introduce the following concepts of the constructor and method of javascript.
These are two useful concepts. I will introduce the
There are three types of objects in javascript: 1. Internal objects such as Array, Boolean, Data, Math, Number, Object, RegExp, and String objects. These Object systems provide us with their own properties and methods. call. 2. class-based objects
// Human base type
Var Person = new (function ()
{
Var sex;
Var name;
This. getSex = function ()
{
Return sex;
}
This. setSex = function (value)
{
Sex = value;
}
}
);
// Students must accept "persons"
Var Student = function (parent)
{
This. _ class _
1. No prompt to refresh the webpageHave you found that when refreshing some webpages, a prompt window will pop up and click "OK" to refresh the page.Some pages do not prompt. If the prompt window is not displayed, the page is refreshed directly.If
This article introduces some common methods of DOM and javascript!
1. Differences among innerText, innerHTML, outerText, and outerHTML
Function:
InnerHTML sets or obtains the HTML in the object's start and end tags.OuterHTML sets or obtains
JS-only Chinese and English characters can be entered
Use a regular expression object (RegExp) in js to judge
Chinese
^ [\ U0391-\ uFFE5] + $
English
^ [A-Za-z] + $
Chinese and English
/^ [\ U0391-\ uFFE5A-Za-z] + $/
Javascript Regular Expressions
Object native typeAn unordered set that can store any type of ObjectsThe following two methods can be used as dictionaries:O. ItemNameO. ["ItemName"]You can use for in to traverse each item in the dictionary.1
Object native type ExtensionObject.
I. cookie OverviewCookie is an attribute of the Document Object.
It enables JavaScript code to persistently store data on users' hard disks and read, modify, and delete the data using JavaScript code.
In this way, information can be saved, and the
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