Opening: JavaScript is an integral part of Ajax technology, so to learn Ajax and the current popular AJAX framework, learning JavaScript is the most important. In this chapter I've sorted out some of the basics of JavaScript, common code, and event totals.
First, the basic knowledge:
1.document.write (""); Output statement
The annotation in 2.JS is//
3. Traditional HTML Document order is:document->html-> (head,body)
4. The DOM order in a browser window is:window-> (navigator,screen,history,location,document)
5. Get the name and value of the element in the form: document.getElementById ("ID number of the element in the form"). Name (or value)
6. A lowercase capitalization JS:document.getElementById ("Output"). Value = document.getElementById ("input"). Value.touppercase ();
Value type in 7.JS: string,number,boolean,null,object,function
The character type in 8.JS converts to a numeric type: parseint (), parsefloat ()
Converts numbers in 9.JS to character type: ("" + variable)
The length of the string in 10.JS is: (length)
The characters in 11.JS are connected with the character story using the + sign.
The comparison operators in 12.JS are: = = equals,!= not equal, >,>=,<.<=
13.JS declaring variable use: var to declare
Judgment statement structure in 14.JS: if (condition) {}else{}
Loop structure in 15.JS: for ([Initial expression];[ Condition]; [Upadte expression]) {Inside loop}
16. The order of the circular abort is: break
function definition in 17.JS: function functionname ([parameter],...) {Statement[s]}
18. When multiple form forms appear in a file, they can be replaced with document.forms[0],document.forms[1].
19. Window: Open Window window.open (), close a window: window.close (), window itself: Self
20. Status bar setting: window.status= "character";
21. Pop-up Message: Window.alert ("character");
22. Pop-up Confirmation Box: window.confirm ();
23. Pop-up Input Prompt box: window.prompt ();
24. Specify the location of the currently displayed link: window.location.href= "URL"
25. Remove the number of forms in the form: document.forms.length
26. Close the output stream of the document: Document.close ();
27. String Append connector: + =
28. Create a document element: Document.createelement (), document.createTextNode ()
29. Methods of obtaining elements: document.getElementById ()