First of all, there are many ways to declare a method, both directly and indirectly, and only the two modes in general are listed:
Let's say the code we're loading is a.js:
var foo=function () {
document.write ("I am a.js content foo () function by
Read the XML data for a day, feeling csdn on this very meticulous. That is, a dot net to write an example of XML file, and JS read the example, is worth a look. (Source:http://blog.csdn.net/flypigluo)
A The XML file used in this note
Two
This method will cause as if it were in a tag string displayed in the specified sizeGrammar
String.fontsize (size)
The following are the details of the parameters:
An integer between Color:1 and 7 that represents a string of signed
This method is used to convert character strings to lowercase, while respecting the current locale. For most languages, this is the same as the return value of toLowerCase.Grammar
String.tolocalelowercase ()
The following are the details
This method finds a match between the strings of a regular expression and replaces the new substring of the matched substring.
The replacement string can contain the following special substitution modes:
Grammar
String.Replace
The Boolean.valueof () method of JavaScript returns the original value of the specified Boolean object.Grammar
Boolean.valueof ()
The following are the details of the parameters:
NA
return value:
Returns the original value of the specified
A function statement is not defined as a new function, and you can define the only way in which your functions are used to construct the use of the operator dynamically.
Note: This is the terminology of object-oriented programming. The first time
The original type is stored directly on the stack (stack), and the reference type is stored on the heap (heap).
The original type is divided into the following 5 kinds: Undefined, Null, Boolean, number, String
Undefined type:
The undefined
All variables in JavaScript are loosely typed, and variable declarations that are different from other object-oriented sounds are strongly typed. Therefore, JavaScript variable declarations are not included in the type. Declare a variable by using
Definitions and usage
The ToFixed () method can be rounded to a number that specifies the number of decimal places.
Grammar
numberobject.tofixed (num) num is required. Specify the number of digits, which are values between 0 ~ 20, including 0
The following checkbrowser () function mainly detects three kinds of browsers (IE, Firefox, Chrome), other browsers are interested in the detection of friends can add their own detection code!
HTML Part code: (Performs a detection function on page
First look at all the complete code:
countdown test Due date
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
HTML Section Code:
You can enter the countdown time in the text
The JavaScript date.getutcday () method returns the day of the week on a specified date, at a common time. The value returned by getUTCDay is the integer corresponding to the day of the week: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so
The JavaScript date.getutcdate () method returns the day of the month on a specified date, at a common time. The value returned by getUTCDate is an integer between 31 and 1.Grammar
Date.getutcdate ()
The following are the details of the
The JavaScript date.getseconds () method returns a second at the specified date, in local time. The value returned by Getseconds is an integer between 59 and 0.Grammar
Date.getseconds ()
The following are the details of the parameters:
The JavaScript date.gethours () method returns hours per local time on a specified date. The value returned by GetHours is an integer between 0 and 23.Grammar
Date.gethours ()
The following are the details of the parameters:
NA
The JavaScript date () method returns today's day and time and does not require any objects to be invoked.Grammar
Date ()
The following are the details of the parameters:
NA
return value:
Return today's date and timeExample:
The Unshift () method of a JavaScript array adds one or more elements to the beginning of the array and returns the new length of the array.Grammar
Array.unshift (element1, ..., ELEMENTN);
The following are the details of the
The JavaScript array reverse () method reverses the array element. The first array element becomes the last element, and the last element becomes the first element.Grammar
Array.reverse ();
The following are the details of the parameters:
The JavaScript array pop () method deletes the last element in the array and returns the element.Grammar
Array.pop ();
The following are the details of the parameters:
NA
return value:
Returns the element that was removed from 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.