Front-end error prone

The long-term error-prone points are recorded here, and will be updated continuously in the future

 

1.Less reference link of CSS series: http://blog.csdn.net/p312011150/article/details/73331300

 

2. Absolute positioning absolute

    We often mistakenly say that absolute positioning is relative to ancestor-level elements with relative positioning attributes. Generally speaking, if the parent element is absolutely positioned (absolute) or not set, the absolute positioning (absolute) inside is automatically positioned with the body. This sentence is wrong.

    Moreover, after watching a lot of videos on the MOOC online, it is said that the superiors of absolute positioning are relative positioning, which seems to be a fixed pattern.

    But CSS does not stipulate that absolutely positioned things must have relative positioning ancestors!

 

    Here I correct it, it should be: as long as the parent element has a position and is not static (the default is static), then the child element with absolute is set as the containing block (the closest). Absolute positioning (Absolute positioning) The reference for the positioning of an element is its containing block, which is positioned relative to its containing block, not necessarily its parent element.

 

3. External JS file limitations (this is found occasionally, record it)

Related properties such as the height of the current document page cannot be obtained from the externally introduced JS file:

When the JS is in an external file, the following JavaScript objects will not be accessible:

window object, document object, parent object

 

4. Detailed explanation of common css processing margin compatible writing

The default margin value defined by Netscape and IE for the body tag is 8px

Instead, Opera defines the default value for padding to be 8px

Therefore, if you want to adjust the edge part of the entire website and display it correctly in Opera, you must customize the padding of the body.

That is our common css initialization compatible writing method

*{margin:0px;padding:0px}

 

5. When reviewing code, tabs with horizontal lines refer to deprecated tabs

 

6. List of differences between GET and POST:

       ①GET back button/refresh is harmless, POST data will be resubmitted (the browser should inform the user that the data will be resubmitted);

       ②GET bookmarks can be bookmarked, and POST bookmarks cannot be bookmarked;

       ③ GET can be cached, POST cannot be cached;

       ④ GET encoding type application/x-www-form-url, POST encoding type encodedapplication/x-www-form-urlencoded or multipart/form-data. use multiple encodings for binary data;

       ⑤ The GET history parameters are kept in the browser history, and the POST parameters are not saved in the browser history;

       ⑥GET has a limit on the length of the data. When sending data, the GET method adds data to the URL; the length of the URL is limited (the maximum length of the URL is 2048 characters); POST has no limit;

       ⑦GET only allows ASCII characters, POST has no restrictions. Binary data is also allowed;

       ⑧ Compared with POST, GET is less secure because the data sent is part of the URL. Never use GET when sending passwords or other sensitive information. POST is more secure than GET because parameters are not saved in browser history or web server logs. GET data is visible to everyone in the URL. POSTed data will not be displayed in the URL.

 

7. The maximum length of get is 2k, and the default maximum length of post is 8M. Can be modified through the PHP configuration file

 

8. What are the common browser kernels?

Trident kernel: IE, MaxThon, TT, The World, 360, Sogou browser, etc. [aka MSHTML]

Gecko kernel: Netscape6 and above, FF, MozillaSuite/SeaMonkey, etc.

Presto kernel: Opera7 and above. [Opera kernel was: Presto, now: Blink;]

Webkit kernel: Safari, Chrome, etc. [Chrome: Blink (fork of WebKit)]

 

9. What is the difference between on and click in jquery?

 

10.jquery object to Dom object --- button operation when the form is submitted

<script type="text/javascript">
    $(function(){
        //submit button
        $('.confirm').on('click',function(){
            $('form').submit();
        });
        //clear button
        $('.clear').on('click',function(){
            $('form')[0].reset();//Form restoration,
             //Because reset() is the syntax of JS, and $('form') is a jquery object, js cannot be used directly.
           //So to convert, there are two methods for jquery object to Dom object ① add subscript; ②.get(0)
        })
    })
</script>

 

11. For the type of form element input, there is a number type, but it is only useful for mobile phones. Used to call up the numeric keypad

 

 

 

 

 

.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326184770&siteId=291194637