1. Functions
String functions
var s=new string ();
var ss= "Hello World";
var sss= "" HELLO, World ";
Alert (Ss.tolowercase ());--Convert to lowercase
Alert (Sss.touppercase ());--Convert to uppercase
Alert (SS.SUBSTR (2,3));--intercept string, starting at index 2, intercept 3 character length, not write the following number is truncated to the last
Alert (ss.substring (2,3));--intercepts a string from the 2nd position to the 3rd position
Sss.splite (",");--separates the string according to the specified character
Ss.length property, String length
Ss.indexof ("World");---Find the first occurrence of world in a string, return 1
Ss.lastindexof ("O");--Find the last occurrence of the position in the string
Time-Date function
var d=new date ();--Current time
var dd=new date (1999,3,2);--Define Time
Dd.getfullyear ();--Take the year
Dd.getmonth ();--Take the month, take out the 1 less
Dd.getdate ();--Date taken
Dd.getday ();--Take the day of the week
...
Dd.setfullyear ();--set year, set month note +1
Mathematical functions
Math.ceil ();--Take the upper limit
Math.floor ();--Take the lower limit
Math.sqrt ();--Open square
Math.Round ();--Rounding
Math.random ();--random number, 0-1
2. All Events
onclick--Click events
ondblclick--Double-click event
onmouseover--Mouse Move in
onmouseout--Mouse Removal
onfocus--Get Focus
onblur--loses focus
onkeyup--trigger when the button is lifted
window.onload--triggered when the button is pressed
window.onresize--Trigger when size changes
window.onload--page load-out trigger
3. Supplement
Block Event bubbling:
Window.event? window.event.cancelBubble = True:e.stoppropagation ();
JavaScript functions, Events