Home >Web Front-end >JS Tutorial >Some notes on javascript review Summary of basic common knowledge_javascript skills
The following is the full content:
2010.11.29
1.[window.]alert();
document.alinkColor
textString.anchor()
navigator.appCodeName
escape("Hi!") returns ascii code
eval("x y") evaluates the string x=10,y=20;eval=30
formName.elementName.focus(); sets the element to become Focus
history.forward() Forward the browser
Date related functions
Date.getDate() Returns a date between 1-31
Date.getDay() Returns the day of the week from Monday to Saturday A value between 0-6
Date.getHours() returns 0-23
Date.getMinutes()
Date.getMonth()
Date.getSeconds()
Date.getTime( ) Get the number of milliseconds from 1970.1.1 to now
Explanation
{
}
Date.getTimezoneOffset() Get the client's time difference GMT
Date.getYear();
history.go();
document.linkName.hash returns the string after # in Url. The same usage is document.links[0].hash,document.location.hash
document.history object
document.history.forward();
document.history.back();
document.history.go(-1), -2
location.host,linkName.host, linkName.port Returns the host name and port
location.hostname
location.href
formName.selectName.options[index].index Returns the subscript of a select element
isNaN() checks whether it is a number
stringName .italics() Set to XIE body format
stringName.lastIndexOf('o'); Return the index of the beginning of a character at the end of the string
stringName.link();
Event
onChange=""
onClick=""
onFocus=""
onLoad=""
onMouseOver=""
onSelect=""
onSubmit=""
onUnload="" When exiting the document
document.open([MIMETYPE])
window.open("url","windows name"[,"windowFeatures"])
Date.parse("Jan 11,1996");
parseFloat(string)
parseInt(string[,radox]);
document.fromName.passwordName
location.pathname,link .pathname,links[index].pathname
windowName.prompt(message[inputDefault]);
protocal:
about,ftp,http,mailto,news,file,javascript
Math.random() returns a random number between 0-1
Math.round(argument) rounding
formName.resetButtonName
window.status
stringName.strike() will character Convert into strikethrough characters
stringNAme.sub() Convert characters into subscript text format
formName.submit() Perform the same action as clicking the submit button
stringName.substring(index1,index2 ) Take the substring
stringName.sup() and convert it into the superscript form
target which specifies a window name string formName.target, forms[index].target,location.target,link.target,links[index ].target
document.title Returns the mid-read value in the