The first step to use this script is to select
CodeAnd copy it to the Rand. js folder.
Copy codeThe Code is as follows: var mess = new array ('code0', 'code1', 'code2 ');
VaR max = mess. length;
VaR num = math. Floor (math. Random () * max ));
This is a question I remember. I haven't answered any questions. I can't help it anymore.
1. In JS, class inheritance is generally used in combination with class transcription and prototype inheritance. In extend of extjs, these two methods are
Suppose: A common
Code:
Gift_list is the ID of a table.
Copy codeThe Code is as follows: var giftbody = Document. getelementbyid ("gift_list"). getelementsbytagname ("tbody") [0];
VaR gifttrs = giftbody. getelementsbytagname ("TR ");
For (VAR I
Example
Result = expression1 >>> expression2
The result is any variable.Expression1 is any expression.Expression2 is any expression.
Description of the unsigned right shift operator in Javascript>>> The operator shifts the bits of expression1
Example
Code:
Result >>>= expression
The parameter is any variable of result.Expression is any expression.
Operation description of shifts value to the right without symbols in JavascriptThe >>>= operator is equivalent to the following
CopyCode The Code is as follows: function allselect ()
{
Try {
VaR checkedcount = 0;
For (VAR I = 0; I {
If (form1.orgids [I]. Checked)
Checkedcount ++;
}
If (checkedcount = form1.orgids. length){For (VAR I = 0; I {Form1.orgids [I]. Checked =
pearl of the Orient Ah! Stop lover quiet Hot Spring your appearance love song 1980 love song 1990 love song 2000 orphan of Asia Pacific > companion childhood proverbs of love comrade lover Miss
You can use the following function to add a certain length to the front or back of the output integer.
CopyCode Code: function padleft (STR, lenght ){
If (Str. length> = lenght)
Return STR;
Else
Return padleft ("0" + STR, lenght );
}
Function
Factory model:
Basic developers may define objects as follows:
VaR OBJ = new object ();
OBJ. Name = "hero ";
OBJ. showname = function () {alert (this. Name );}
One problem here is that if we want to use the OBJ object in multiple places
Program
Although it is difficult to start learning, it is very convenient and meaningful to use as long as you understand it. Javascript also provides this keyword, but it is much more "messy" than the classic OO language.
Let's take a look at the confusion
Note the followingCodeTo load jquery, please download the latest version from the official website.
Copy code The Code is as follows:
JavaScript operations on the gridview for automatic calculation
// GlobalVaR TBL;// Change the total
Today, I found a function that responds to the scroll wheel on the Internet and changed it to the following class.
CopyCode The Code is as follows: function wheelevent (OBJ, handle)
{
This. Handle = handle;
// Different events between Firefox and
The following describes how to make the indexof function in Javascript case-insensitive.
Replace all of them with uppercase or lowercase letters, and then compare them.
This is a simple practice!
The first occurrence of a substring In the indexof
The table. Rows set contains cell objects.
Cell. innerhtml = " 123 "
In innerhtml of table, 123
Cell. innerhtml = "123"In innerhtml of table, the value is 123 .
Therefore, cell. innerhtml does not need to be added
In addition, I did not
CopyCodeThe Code is as follows:
Function openokurisakipopup (OBJ)
{
VaR rowindex, c
O = OBJ
While (O. tagname! = "TD ")
O = O. parentnode
If (O. tagname! = "TD") Return
C = O. cellindex
While (O. tagname! = "TR ")
O = O. parentnode
If (O.
IE: a prompt is displayed when you execute more than JScript engine statements.
Firefox: a prompt is displayed when the task is executed for more than 10 seconds.
Safari: a prompt is displayed when the execution lasts for more than 5 seconds.
Opera:
All the Web developers know that JS
Program Debugging is quite depressing, because the syntax of this language is more flexible first, it is a weak type of scripting language, and many errors cannot be controlled, the most painful thing 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