Using Python to manipulate web front-end Fundamentals 2

Source: Internet
Author: User

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

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.