Finishing the front-end JS face question

Source: Internet
Author: User

, HTTP Status Code

Continue continue, generally when sending a post request, the server will return this message after the HTTP header has been sent , indicating that Then send the specific parameter information

OK normal return information

201 Created Request succeeds and the server creates a new resource

202 Accepted Server has accepted the request but has not processed

301 Moved Permanently The requested page has been permanently moved to a new location.

302 Found Temporary redirection.

303 See other temporary redirection, and always use GET to request a new URI.

304 Not Modified The requested Web page has not been modified since the last request.

the request server cannot understand the requested format, and the client should not attempt to initiate the request again using the same content.

401 Unauthorized request is not authorized.

403 Forbidden prohibit access.

404 Not Found could not find a resource to match the URI.

the most common server-side error for the Internal server error.

The 503 Service unavailable server side is temporarily unable to process requests (possibly overloading or maintenance).

, git fetch and the git Pull the District Don't

Git pull: the equivalent of getting the latest version from remote and merge to local

git fetch: The equivalent of getting the latest version from remote to local, not automatically merge

17. How to understand the position of front-end interface engineer? What is the future of it ?

The first requirement is that our code is highly multiplexed and low-coupling, so that the file is small, well maintained, and well-scaled.

The front end is the most user-close programmer, close to the backend, database, product Manager, operations, security.

1. Realize interface interaction

2. Enhance the user experience

3. Accelerate front-end data interaction

The front-end is the most user-close programmer, the ability of the front end is to allow the product from 90 to 100 points, or even better,

participate in the project, fast and high-quality implementation, accurate to 1px;

with team members, UI design, product manager communication;

good page structure, page refactoring and user experience;

handle hack, compatible, write graceful code format;

optimized for servers, embracing the latest front-end technology.

- the difference between document load and document ready
Document.onload is executed after the structure and style are loaded. js
Document.ready native species there is no such method, there is $ () in jquery. Ready (function)

19. introduce JS the basic data types and built-in objects .

Undefined, Null, Boolean, number, String

What built-in objects JS has.

object is the parent object of all objects in JavaScript

Data encapsulation Class objects: Object, Array, Boolean, number, String

Other objects: Function, Argument, Math, Date, REGEXP, Error

20. List several JavaScript Basic code specification for .

(1) Do not declare multiple variables on the same line

(2) If you do not know the length of the array, use push

(3) Please use ===/!== to compare true/false or values

(4) Use single quotation marks for strings "(because most of the time we have strings.) Special HTML will appear ")

(5) Use object literals instead of the new Array form

(6) Never declare a function in a non-function block and assign that function to a variable. Browsers allow you to do this, but they parse different

(7) Do not use global functions

(8) Always use VAR to declare variables, if not to do so will result in global variables, we want to avoid polluting the global namespace

(9) The Switch statement must have the default branch

(10) Use/**...*/for multi-line annotations, including descriptions, specifying types, and parameter values and return values

(11) The function should not sometimes have a return value, sometimes no return value

(12) You must add a semicolon to the end of the statement

() The For loop must use curly braces

If statement must use curly braces

Variables in the for-in loop should be scoped explicitly using the var keyword to avoid scope contamination

(16) Avoid a single character name, so that your variable name has a descriptive meaning

(17) Use hump naming conventions when naming objects, functions, and instances

(18) Assigning a method to an object prototype, rather than overwriting the prototype with a new object, overwriting the prototype causes the inheritance to become problematic

(19) When attaching data to an event, pass in a hash instead of the original value, which allows subsequent contributors to add more data to the event data without having to identify and update the event handler

21. what data types are returned by the typeof of JavaScript
Object number Function Boolean Underfind

A , example of 3 coercion type conversions and 2 implicit type conversions?
Force (parseint,parsefloat,number)
implicit (==–===)

at ,split () join () Difference
The former is the form of an array of cuts, the latter is the conversion of arrays into strings

- , array method pop () push () unshift () Shift () (List all the methods you have learned to add or delete to the array)
Push () trailing add pop () trailing delete
Unshift () header add Shift () header Delete

The push method is used to add or append one or more elements to the end of an array. With this approach, multiple elements can be attached by passing multiple parameters.

The Unshift method is like a push method that works at the beginning of an array. This method is used to add one or more elements to the beginning of the array.

- ,IE and DOM event stream differences , what is DOM event flow
1. The order of execution is different,
2. Different parameters
3. Event not added on
4.this pointing problem
Dom Event flow See 1190000004463384 (be sure to understand and write the answer after understanding)


- The difference between the Get and post methods when Ajax requests
one in the back of the URL and placed inside the virtual carrier
There is a size limit
Security issues
Apply Different One is the forum and so on only need to request, one is similar to change the password


- , the style of the element / How classes change ?

This can be done in the following ways:

document.getElementById ("MyText"). Style.fontsize = "20?;

Or

document.getElementById ("MyText"). ClassName = "Anyclass";

- ,cookies and the Session the Difference :

1. The cookie data is stored on the client's browser and the session data is placed on the server.

2, the cookie is not very safe, others can analyze the cookie stored in the local and cookie deception

Consider that security should use the session.

3. Session will be saved on the server for a certain period of time. When access is increased, it will be more likely to occupy your server's performance

The cookie should be used in consideration of mitigating server performance.

4, a single cookie can not save more than 4K of data, many browsers restrict a site to save up to 20 cookies.

5, so personal advice:

Storing important information such as login information as session

Additional information can be placed in a cookie if it needs to be retained

in ,DOM Operation -- How to add, remove, move, copy, create, and find nodes .

1) Create a new node

Createdocumentfragment ()//Create a DOM fragment

CreateElement ()//create a specific element

createTextNode ()//Create a text node

2) Add, remove, replace, insert

AppendChild ()

RemoveChild ()

ReplaceChild ()

InsertBefore ()//And no InsertAfter ()

3) Find

getElementsByTagName ()//by tag name

Getelementsbyname ()//The value of the Name property of the element (ie is strong in fault tolerance,

will get an array that includes the ID equals the name value)

getElementById ()//through element ID, uniqueness

- ,null and the undefined the Difference ?

Null is an object that represents "none", and a value of 0;undefined is a primitive value that represents "none", and a value of Nan when converted to a number.

When the declared variable has not been initialized, the default value for the variable is undefined.

Null is used to represent an object that does not already exist, and is commonly used to indicate that a function is attempting to return a nonexistent object.

Undefined means "missing value", that is, there should be a value here, but there is no definition. Typical uses are:

(1) The variable is declared, but when it is not assigned, it is equal to undefined.

(2) when calling a function, the argument that should be supplied is not provided, which equals undefined.

(3) The object does not have an assigned property, and the value of this property is undefined.

(4) When the function does not return a value, undefined is returned by default.

Null means "No object", that is, there should be no value at all. Typical uses are:

(1) As a function parameter, the parameter of the function is not an object.

(2) As the end point of the object prototype chain.

to ,new what exactly did the operator do? ?

1.Create an empty object, and the This variable references the object, and also inherits the prototype of the function.

2, properties and methods are added to the object referenced by this.

3. Thenewly created object is referenced by this and the last implicitly returns this .

var obj = {};

obj.__proto__ = Base.prototype;

Base.call (obj);

+ , what is JavaScript? ( This is the basic problem, for many programmers also send sub-problem !)

JavaScript is a client and server-side scripting language that can be inserted into an HTML page and is currently the more popular web development language. At the same time, JavaScript is an object-oriented programming language.

Similar basic topics include: What types of JavaScript are there? Who Invented JavaScript?......

33. List Java and the JavaScript the difference between ?

Java is a very complete and mature programming language. In contrast, JavaScript is a programming language that can be introduced into HTML pages. The two languages are not completely interdependent, but are designed for different purposes. Java is an object-oriented programming (OOPS) or structured programming language, similar to C + + or C, while JavaScript is the client-side scripting language, which is called unstructured programming.

  the , what is a global variable ? how these variables are declared, what are the problems with using global variables ?

Global variables are variables that are available throughout the length of the code, meaning that these variables have no scope. The var keyword is used to declare a local variable or object. If the var keyword is omitted, a global variable is declared.

Example://Declare a global globalvariable = "Test";

The problem with using global variables is the conflicts between local and global variable names. In addition, it is difficult to debug and test code that relies on global variables.

/ git fetch and the git Pull the District Don't

GitPull: the equivalent of getting the latest version from remote and merge to local

git fetch: the equivalent of getting the latest version from remote to local, not automatically merge

36, Tell me about your MVC and the MVVM the rationale Solution

Mvc

View Transfer command to Controller

Controller needs Model to change state after completion of business logic

Model sends new data to View, user gets feedback

All communications are one-way.

Angular it uses two-way binding (data-binding): The change of view is automatically reflected in ViewModel, and vice versa.

Component Model, View, ViewModel

View:ui interface

ViewModel: It is the abstraction of view, which is responsible for the information transformation between view and model, and transmits the command of view to model;

Model: Data Access Layer

Panax Notoginseng, attribute and the Property What's the difference? ?

attribute is the attribute that DOM elements have in the document as HTML tags;

The property is the attribute that the DOM element owns as an object in JS.

So:

For the standard attributes of HTML, the attribute and property are synchronized and are automatically updated.

However, for custom properties, they are not synchronized,

Finishing the front-end JS face question

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.