Getyear ():The returned year value is a two-digit integer during the 1900-1999 period, representing the difference between the year of storage and January 1, 1900.
IE corrected getyear (), while other browsers did not.
TestCodeAs follows:
1
Today, I was surprised to find a problem:
Parseint (document. all [text]. value); when the value of a bitwise is obtained, if the value of the input is, the obtained values are both positive values 1 and 2, however, when values are written, the
Now, I have found that the most influential JavaScript article is from the blog site. This sentence is true and true, because no one has discussed it in other forums. Then, I am very happy to talk about the articles I have read today. Although I
Method 1: extract JQ (source network). This method is complete.
Array.prototype.unique = function(){ var results=this.sort() for ( var i = 1; i
Method 2: complete method.
Array.prototype.unique = function(){ var newArray = [],
Maybe you may wonder why Object-Oriented Programming starts from arrays? This is because ...... The relationships between them ...... Hey, here we will sell a token first. Let's take a look at what the familiar array looks like in JavaScript.
1.
In many languages, functions (Methods in Java) are very different from objects. A function is defined as an object action or global (like the main function in C ++ ). However, in JavaScript, the boundaries between functions and objects are not so
Note: I haven't written it for a long time. Today, I copied my article on the company's Intranet to show my face and just switched to Web development. So I started to learn javascript!
Before the introduction of namespaces, a headache for
Method 1: Object literal
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->Var obj = {
A: "value ",
B: "value ",
MethodA: function (){},
MethodA: function (){}
}
Note that only an object obj is created
Generally, the most common syntax format of JavaScript code is to define function xxx () {/* code... */}. Many such functions are often defined. Function names are prone to conflicts, especially when multiple js files are introduced. Therefore, it
1. Use [] to call object attributes and Methods
Function User (){This. age = 21;This. sex = "male? ";}Var user = new User ();Alert (user ["age"]);
2. dynamically add, modify, and delete object attributes and Methods// Define a classVar user = new
For TextBox (others have not been passed), if the ReadOnly encoding is directly set to true on the aspx plane,
At the front-end, you cannot jump in. Everyone on Earth knows that !! >_However, you can use js to perform future value operations.
// This is the json string to be converted.
Var jstr = "{'A': 100, 'B': 'aaa '}";
// Pass the following statement to assign the object data described in this statement to this m object
Eval ("m =" + jstr );
// Now m is an object. to access
The setinterval action is used to call a function, method, or object every certain time when an animation is played. You can use this action to update the variables or update time display from the database. The syntax format of the setinterval
Javascript compatibility with multiple browsersI. document. formName. item ("itemName ") Problem description: in IE, you can use document. formName. item ("itemName") or document. formName. elements ["elementName"]; In Firefox, only document.
As you may know, the execution environment of Javascript is "single thread ).
A single thread means that only one task can be completed at a time. If there are multiple tasks, you must queue up, complete the previous task, and then execute the next
In ecmascript5, some new methods are introduced for array objects, which are listed below:
Item positioning:Indexof ()/Lastindexof ():
Both methods accept two parameters: the item to be searched and the optional index from where to start searching.
If ("\ v" = "v") // this judgment is true only in IE, including IE 8.
My previous method, 32-byte version:
Try {IE = window =! 1} catch (e) {IE =! 0}
It is very effective, isn't it? This technique is usually applied to the library/hack proof. But
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