First, page layout:
1. Main Station layout
2. Background Management layout:
Position property: 1. Fixed: Always in one place
2. Relative: no meaning alone
3. Absolute: The first position, at the specified position, when the scroll wheel, not in the specified position.
Second, JavaScript functions:
1. Normal function: function () {Functional content}
2. Anonymous functions
3. Self-executing functions
Third, JavaScript serialization and Escape:
1. Convert a list to a string: Json.stringify (LI)
2. Convert the string to a list: Json. Parse (str)
3. Encode (URL) escape
4. Decode (URL)
5. Escape () escapes the string
6. Unescape () to decode the escaped character code
Iv. Eval
1. Python: eval (expression) turns the string into a transport process; exec (execution code)
2. javascript: eval combines the two functions of python above.
Five, Time:
Date Object
Getminutes Get minutes
setminutes Setting minutes
Vi. Scope
1. Other languages, using code blocks as scopes, can be used only within this section of code
2. JavaScript: The function is scoped, the scope of the function has been created before the function call, the scope of the function has a scope chain, and has been created before the function call.
3. Local variables inside the JavaScript function have a pre-declared effect.
Seven, Dom: document Operation model;
1. Find: Direct lookup: document.getElementById ()
Indirect lookup: Innertext get text; InnerHTML get links; value; Gets the text of input; Select gets the value of the selected values; textarea gets the text content;
Class operation: Classname;classlist.add;classlist.remove;
Property operation: Attributes;setattribute (Key,value); GetAttribute (key);
Other operations:console.log输出框;
alert弹出框;
confirm确认框;
URL和刷新:
location.href获取URL;
location.href =
"url"
重定向;
location.reload()重新加载;
定时器:
setInterval多次定时器;
clearInterval;清除多次定时器;
setTimeout单次定时器;
clearTimeout清除单次定时器;
Viii. events: Two methods of binding events: 1. Direct tag Binding onclick= "xxxx ()"; 2 Gets the DOM object and then binds: document.getElementById ("xx"). onclick;
Using Python to manipulate web front-end Fundamentals 2