VaR
STRF
=
Filename. substr (filename. Length
-
4
,
4
);
//
Get the file suffix (the last four character strings in the string)
String. substr (N1, N2) is a string that is commonly used to extract the specified length (N2) from the
A prototype is a good thing. Generally, the object prototype should not be extended. adding a new method to the prototype is a good choice.
Let's take a look at how to get the maximum and minimum values for the array. The most stupid method is
Document. Form. item:
Many statements such as document. formname. Item ("itemname") exist in the existing code and cannot be run in Firefox.Solution:
Use document. formname. elements ["elementname"].Collection object problems:
In the existing Code,
Let's take a look at how Flex calls functions in JavaScript.
Flexconnectjavascript. mxml Import flash. External .*;Public Function invokejavascript (): void{Lblresult. Text = externalinterface. Call ("returnthename", "huangxi ";}]>
added to
// Var temp = Document. getelementbyid ("test_2 ");// Temp. style. Position = "absolute ";// Temp. style. Top = pos. Y + "PX ";// Temp. style. Left = pos. x + "PX ";
// Get the X and Y position of the object. The accept object does not receive the
Http://www.zj-blog.com/html/2007/04/200704101145040237.htm.
Node is often translated as a node. In an object (which can be simply understood as an HTML page), an attribute name = "AAA" can be a node, A ...... can also be a node ...... is also a
Document directory
Deep understanding of JavaScript closures
Before posting: During this time, Lua was exposed for work reasons. I bought a Lua Program Design (version 2. For the first time, I was puzzled by the "closure. Fortunately, I found a
If there is a certain JavaScript foundation, it is easier to make floating advertisements. Code directly:
untitled document
Key points:
In the preceding code, use document.doc umentelement. Do not use the old document. Body. Otherwise, it
Create and use a JavaScript Regular objectDeclare a JavaScript Regular ExpressionVaR recat = new Regexp ("cat ");You can alsoVaR recat =/CAT/; // Perl style (recommended)
Learn the most common test exec match search replace split six methods1) test
During this time, JavaScript is often used to obtain the submitted data in various forms. Considering code consistency and logic simplification, the following two JS functions are created to obtain data in form in a unified manner. Data is obtained
The visibility attribute is used to determine whether an element is displayed or hidden. Visibility = "visible | hidden" is used to indicate that the element is displayed, while "hidden" indicates that the element is hidden ).
When visibility is set
Javascript type conversion,
String to numeric: parseint ();
Converts a string to a floating point decimal point: parsefloat ();
During JSON data processing, the application needs to convert the string type to the object type.Although string itself
A little research on obtaining the visible window size of various browsers.
In my local test:
It can be used in IE, Firefox, and opera
Document. Body. clientwidth
Document. Body. clientheight
It is very simple and convenient.
In the company's
As a scripting language, JavaScript provides operators that operate data values like its predecessors, such as arithmetic operators, bitwise operators, Relational operators, and equal operators. You can use the JS operator in the same way as other
> Where to place Javascript
Javascript can be placed in the head or body or referenced externally.
HTML embedded Javascript
External Reference Javascript
Put. js files in the website directory, which usually stores scripts in sub-directories,
1. Get the dropdownlist Control Value
Function getdllvalue (ID ){VaR r = Document. getelementbyid (ID );For (VAR I = 0; I If (R [I]. Selected ){Return R [I]. text;}}}
PS: ID is the Control ID, which must be enclosed by quotation marks.
VaR text =
SharePoint 2010-change UI Language with your criptif you want to use HTML/JavaScript to change UI Language, you can use the script below:
(Note: In the page, there is the function onselectionchange, so you have to change name if you want to use
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.