Summary: in this set of questions, I have brushed a lot of discarded elements before HTNL5, I thought at the beginning that discarded elements will not be tested, but there are a lot of such a proportion in the interview questions, need to review.

Json XML HTML Discarded element inheritance JS synchronous asynchronous mechanism Empty element redrawing and rearranging

1.

1. Ins tags are used to define insert elements 2. Keygen key pair generator fields for forms deprecated by new WEB standards 3. The commands used to define what a user might call support IE9

2. Inheritance order



Inheritance order

HTMLDivElement > HTMLElement > Element > Node > EvenTarget

3JS synchronous asynchronous mechanism



What take an examination of here is JS running mechanism! Events (Click,focus, etc.), timers (setTimeout and setInterval), ajax, all trigger asynchrony, belong to asynchronous tasks; Js is single threaded, can only do one thing at a time, priority processing synchronization tasks; Execute from top to bottom according to the code, encounter asynchrony, suspend, put in the asynchrony task, continue to execute the synchronization task, only when the synchronization task is finished, to see if there are asynchronous tasks, and then execute in order! I = 4(I <length); onclick = 4(I <length); So every time the for loop executes, the onclick event function is suspended four times; At the end of the for loop, the click event triggers four onclick functions, followed by four fours!

4 html5 deprecated elements

Elements abolished in 5HTML5

Basefont, BIG, Center, font, S, strike, tt, u. These elements are purely for display services, HTML5 advocates to display functions in CSS unified editing.

2. Stop using frame frames.

Frameset, frame, noframes. HTML5 does not support frame frame, only support iframe frame, or by the server created by multiple pages in the form of page, delete the above three tags.

3. Elements supported by only some browsers

Labels such as applet, BGSound, BLINK, and Marquee.

6 empty elements

In HTML there are the following empty elements:


when the span is present


The two attributes of the body tag are BACKGROUND and BGColor. Background can only write the URL to represent the background image, bgColor to write the background color is not supported by Html5, Html4.01 has been deprecated

7json



A. “# div. red” selects all div elements with red in the CSS class attribute

B.{” name “:” John “, “age” : 18}, add “”(double quotation marks) to the keys in the JSON data. I didn’t pay attention to that detail when I did it

D.Different browsers provide different programming environments(including HTML, CSS, JS programming inconsistent), so in the programming to use -MS, -webkit, -moz to achieve the compatibility of different browsers (solve the CSS programming inconsistent)

E.js files are loaded in the order introduced in HTML (not last) and executed immediately after loading, blocking subsequent content of the page (including rendering of the page and downloading of other resources)

F. Arrow functions do not have the super keyword, so arrow functions do not inherit any objects, and therefore cannot inherit the Function class.

8 redraw and rearrange

Reflect:

Repaint is the redrawing of a DOM element; Reflow is the entire page rearranged, that is, all DOM elements of the page rendered.

How to trigger:

Style changes cause repaint and reflow.

Changes to repaint that do not involve any DOM element typography, such as color/text-align/text-decoration, etc.

Except for the DOM element style modification mentioned above, it is basically reflow. For example, any changes to the style of an element that involve length, width, line height, border, display, etc.

Common triggering scenarios:

Trigger repaint: color changes, such as color=# DDD; Text-align =center; A: Hover also causes redrawing. :hover causes color changes that do not cause page backflow style changes. There are so many things to wait for, it’s too hard to write them all at once. Trigger reflow: width/height/border/margin/padding changes, such as width = 778 px; Animation, :hover and other pseudo-classes caused by changes in the expression of elements, display=none caused page backflow; AppendChild and other DOM elements; Font class style modification; Some of the background changes will only trigger repaint after being optimized by the browser manufacturer. Of course, Internet Explorer does not need to consider this. Scroll page, this is inevitable; Resize page, the desktop version for browser size zoom, mobile, have not played with the drag application, resize application window size multi-window operating system. Read the attributes of an element (this is unintelligible, but technologists say so, so consider it a theorem) : Read the elements of certain attributes (offsetLeft and offsetTop, offsetHeight, offsetWidth, scrollTop/Left/Width/Height, clientTop/Left/Width/Height, getCompu TedStyle (), currentStyle(in IE));

9xml

10 xml json



B —– html-Hyper Text Markup Language, is designed to display data, the core of the data appearance. An HTML documentWeb XML-Extensible Markup Language is designed for structuring, transmitting, and storing data. The core lies in the content of the data. The XML documentPlain text You can choose to use XML to transfer data and HTML to format and display data in web applications. They are not substitutes of similar competition, they cooperate and complement each other. So from a design perspective, HTML and XML are like Java and Javascript, or Leifeng and Leifeng pagoda — independent of each other, with little or no relationship.www.jianshu.com/p/5f5ebefd0…– — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — E JSON can contain more structured information, are more likely to express different data formats, like Numbers, String and NULL values, and even arrays.