The drag and scale here is a little more complex than the general selection box. You can set a fixed trigger point of eight orientations (directions), and set the minimum range, maximum range, and proportional scaling.
Same as drag-and-drop,
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 through the constructor
Test. Show (); // output 2 and 'test',
CodeAs follows:
Copy codeThe Code is as follows:
The page content is refreshedCopy codeThe Code is as follows: Document. getelementbyid ("infoa"). SRC require 'B .htm'
Is it clear That Ajax is usually used? Do you still have no
function geturlarg (seekarg) { var url = location. href; // use regular expressions to separate the parameters between the question mark and the well number, such as from the http://www.jb51.net/testjs.htm? P = 1 & t = 1 & U = 1 # In test, P = 1 &
Same paragraph
Code , Two calls, one pass, and one exception:
Function clearselect (OBJ ){
If (OBJ & obj. Options)
OBJ. Options. Length = 0;
}
The following are some previous experiences:
These are two classic exceptions, which are difficult to
After more than 10 JS files are introduced to the same webpage,
Functions with the same name in each JS are prone to conflicts.
For example, the addcssstyle method is written in the xxx library,
The YYY Library also writes an addcssstyle method,
The
Function quantity. It is applicable to functions that are only used once and do not need to be named. In the following example, although there is a fact function name, the latter is only used for self-calling.
CopyCode The Code is as follows: var F
Summary of JS learning today:
When will the script be executed:
1. Execute the script when opening the page
When the browser opens an HTML document, it will explain the entire document from the beginning, including HTML tags and scripts. If the
No error message is displayed in firebug. When you open IE, you will encounter a "not implemented error". No errors have been found in the past based on the location indicated in IE. It seems that the error location of IE is not accurate. In
Advantage: You can also click the body area to hide the drop-down menu and it does not conflict with the existing onclick event of the body.
Disadvantages: Please point it out and accept it modestly!
Run box
Code It seems that there are so many
Test included in the book
Code As follows:
Copy code The Code is as follows:
example
Note: the latest versions of Firefox seem to have fixed the String concatenation problem. if you are using Firefox 1.0 or later, the string buffer may be
1. Do not make any assumptions
(JavaScript is an unreliable Assistant)
One of the most important features of JavaScript that may not be abrupt is-you have to stop any assumptions:
* Do not assume that JavaScript is available. You 'd better think
Method 1: setattribute VaR OBJ = Document. getelementbyid ("OBJ ");
OBJ. setattribute ("onclick", "javascript: Alert ('test ');");
Here, setattribute is used to specify the onclick attribute, which is simple and easy to understand,
However, ie does
If (document. form1.csrq. value = ""){
Alert ("Enter the date of birth! ");
Document. form1.csrq. Focus ();
Return false;
}
If (document. form1.csrq. value = ""){
Alert ("Enter the date of birth! ");
Document. form1.csrq. Focus ();
Return false;
}
1. The simplest thing is to transfer data from forms on the same webpage.
For example, a webpage has two forms, one text box and one button in each form. Click the button to operate on the value of the text box of the other party. The example here
All constructors are objects, and not all objects are constructors. Each constructor has a prototype attribute used to implement prototype inheritance and share attributes. An object is created using a new expression. For example, a new string ("A
The magic weapon is concurrent. Thread, which is actually a JS library. You can download it from the website.
Source code . How to use it?
Simple
Concurrent. thread. create (F, A1, A2 ,...) f. For the function to be called, A1 and A2 are the
See the following two implementation methods:
JS checkbox Method 1:
CopyCode The Code is as follows: function checkall ()
{
VaR code_values = Document. All ['Code _ value'];
If (code_values.length ){
For (VAR I = 0; I {
Code_values [I]. Checked
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