Related knowledge points
Data types, operations, Objects, Function, inheritance, closures, scope, prototype chain, events, RegExp, JSON, Ajax, DOM, BOM, Memory leak, Cross-domain, asynchronous loading, template Engine, Front-end MVC, front-end MVVM, Routing, Modularity, Http, Canvas, jQuery, E CMAScript 2015 (ES6), Node.js, AngularJS, Vue, React......
Questions & Answers
- Introduce the basic data types of JS.
Undefined,Null, Boolean,Number,StringCopy the code
- Describe the built-in objects in JS.
ObjectIs the parent object of all objects in JavaScript:Object,Array,Boolean,Number,StringOther objects:Function, the Argument,Math,Date,RegExp,ErrorCopy the code
- List a few basic JavaScript code specifications.
(1Do not declare multiple variables on the same line (2If you don't know the length of the array, use push (3) please use ===/! = = to comparetrue/falseOr the value (4Use single quotes on stringsBecause most of the time our string. Special HTML will appear ") (5) using object literals insteadnewThe form Array (6Never declare a function in a non-function block and assign that function to a variable. Browsers allow you to do this, but they parse differently (7Do not use global functions (8Always use var to declare variables. Failure to do so will result in global variables. We want to avoid polluting the global namespace.9The Switch statement must havedefaultBranch (10Use the / * *... */ Comment multiple lines, including the description, specifying the type, and parameter values and return values (11A function should not sometimes return a value and sometimes not (12Always end a statement with a semicolon (13)forLoop must use curly braces (14)ifStatements must use curly braces (15)for-inVariables in loops should be explicitly scoped using the var keyword to avoid scope contamination (16Avoid single character names and make your variable names descriptive (17) Use the camel name rule when naming objects, functions, and instances (18Assigning methods to object prototypes rather than overwriting them with a new object, which can cause inheritance problems (19When attaching data to an event, passing a hash instead of the original value allows future contributors to add more data to the event data without having to find and update the event handler for that eventCopy the code
- What do call and apply do? What’s the difference?
callandapplyThe function is basically the same, is to achieve inheritance or conversion of object Pointers; The only exception is that the former parameter is listed, while the latter is stored in an array;callorapplyFunctionality is to implement inheritance; Similar to the object-oriented extends function; But it's written differently; Grammar:.callObject [, parameter1, the parameter2. ] );// The parameter is the object parameter, not the method parameter; .apply(Object, parameter array)Parameter array :[parameter 1, parameter 2,......]Copy the code
- Push ()-pop()-shift()-unshift()
The push method adds a new element to an array and returns the array's new length value. var a=[1.2.3.4]; a.push(5); The pop method removes the last element in the array and returns it. var a=[1.2.3.4]; a.pop(); The Shift method removes the first element in the array and returns it. var a=[1.2]; alert(a.shift()); The unshift method inserts the specified element at the beginning of the array and returns the array.Copy the code
- Write the media query key CSS code with a screen larger than 1024 and smaller than 1360
if ((screen.width == 1360) && (screen.height == 1024)){ setActiveStyleSheet(CSS1); }Copy the code
- Express your understanding of how javascript this works
In functions:thisUsually an implicit parameter. Out of function (top-level scope) : in the browserthisRefers to a global object; In Node.js, modules (module(exports). Passed to theevalString in () : ifeval() is called directly,thisRefers to the current object; ifeval() is called indirectly,thisGlobal object.Copy the code
- What are the features of JavaScript prototypes, prototype chains?
Each object initializes a property within it, prototype(Prototype), when we access the property of an object, if the property does not exist in the object, then it will look for the property in prototype, which will have its own prototype, and so on and so on, that is the concept of prototype chain. Relationship: the instance. The constructor. Prototype= instance.__proto__ features:JavaScriptObjects are passed by reference, and each new object entity we create does not have a copy of its own prototype, and when we modify the prototype, the objects associated with it inherit the change. When we need a property,JavaScriptThe engine first looks to see if the property is present in the current object, and if not, looks for its prototypeIf the object has this property, and so forth, consistently retrievedObjectBuilt-in objects.function Func() {}Func.prototype.name = "Xiaosong"; Func.prototype.getInfo = function() { return this.name; } var person = new Func(a);console.log(person.getInfo()); //"Xiaosong" console.log(Func.prototype); //Func { name = "Xiaosong", getInfo = function() }Copy the code
- How many types of values does JavaScript have? Can you draw their memory map?
Stack: primitive data type (Undefined,Null.BooleanThe Number,StringHeap: refers to a data type (object, array, function).// The storage location is differentRaw data types are stored directly on the stack (stack), occupies a small space, fixed size, belongs to the frequently used data, so it is stored in the stack; Reference data type Objects stored in the heap occupy large space, size is not fixed, if stored in the stack, will affect the performance of the program; The reference data type stores a pointer on the stack to the starting address of the entity in the heap. When the interpreter looks for a reference value, it first retrieves its address in the stack and then retrieves the entity from the heap.Copy the code
How does JavaScript implement inheritance?
(1) structural inheritance (2) Prototype inheritance (3) Instance inheritance (4) copy inheritance// The prototype mechanism or the apply and call methods are easier to implement. We recommend using a mixture of constructors and prototypes. function Parent(a) { this.name = 'song'; } function Child(a) { this.age = 28; } Child.prototype = new Parent(); // Parent is inherited from the prototype var demo = new Child(); alert(demo.age); alert(demo.name); // Get inherited attributesCopy the code
- What are the different ways that JavaScript can create objects?
Javascript object creation is simply a matter of using built-in objects or a variety of custom objects, but it can also be usedJSON; But there are many different ways to write it, and you can mix it up.// (1Person ={person={person={firstname:"Mark".lastname:"Yun".age:25.eyecolor:"black"}; (2) withfunctionTo simulate a constructor with no argumentsfunction Person(){} var person = new Person(); // Define a function that, if "instantiated" with new, can be considered a Class person.name = "Xiaosong"; person.age = "23"; person.work = function() { alert("Hello " + person.name); } person.work(); (3) withfunctionTo simulate the parameter constructor to implement (withthisKeyword defines the context properties of the construct.function Person(name,age,hobby) { this.name = name; // This scope: current object this.age = age; this.work = work; this.info = function() { alert("My name is" + this.name + "This year" + this.age + "Age, a." + this.work); }}var Xiaosong = new Person("WooKong".23."Program ape"); // instantiate and create objects Xiaosong.info(); // Call info() (4) to create (built-in objects) in factory modevar jsCreater = new Object(a); jsCreater.name ="Brendan Eich"; // The inventor of JavaScript jsCreater.work = "JavaScript"; jsCreater.info = function() { alert("I am"+this.work+"The inventor"+this.name); } jsCreater.info(); (5) Prototypefunction Standard(){} Standard.prototype.name = "ECMAScript"; Standard.prototype.event = function() { alert(this.name+"Is the standard specification for scripting languages"); } var jiaoben = new Standard(); jiaoben.event(); (6) to create in a hybrid mannerfunction iPhone(name,event) { this.name = name; this.event = event; } iPhone.prototype.sell = function() { alert("I am"+this.name+"I'm an iPhone5s."+this.event+"~ haha!"); } var SE = new iPhone("iPhone SE"."Official Refurbishment Machine"); SE.sell();Copy the code
- What does Eval do?
Its function is to parse the corresponding string intoJSCode and run; Eval should be avoided because it is unsafe and very performance-intensive (2AjsStatement, one execution).Copy the code
- What is the difference between null and undefined?
nullIndicates that an object is defined with a "null value";undefinedIndicates the value does not exist.typeof undefined //"undefined" undefined: is a representation"No"The original value or representation of theta"Missing value", is that there should be a value here, but it is not defined yet. Returns when attempting to readundefined; For example, when a variable is declared but not assigned, equalsundefined.typeof null //"object" nullIs an object (empty object, without any properties or methods); For example, as a parameter of a function, the parameter of the function is not an object. Note: in validationnullWhen, be sure to use === because == cannot be distinguishednullandundefinedCopy the code
- Can I write a generic event listener function?
/ / Event toolkit, from:github.com/markyunmarkyun. Event = { // After the page is loaded readyEvent: function(fn) { if (fn == null) { fn = document; } var oldonload = window.onload; if (typeof window.onload ! ='function') { window.onload = fn; }else{ window.onload = function() { oldonload(); fn(); }; }},/ / sight, respectively demo0 | | not | | IE way to bind the event // Parameters: operation element, event name, event handler addEvent: function(element,type,handler) { if (element.addEventListener) { // Event type, function to execute, whether to capture element.addEventListener(type,handler,false); }else if (element.attachEvent) { element.attachEvent('on' + type, function() { handler.call(element); }); }else { element['on'+ type] = handler; }},// Remove the event removeEvent: function(element,type,handler) { if (element.removeEventListener) { element.removeEventListener(type,handler,false); }else if (element.datachEvent) { element.datachEvent('on' + type,handler); }else{ element['on' + type] = null; }},// Prevent events (mainly event bubbling, since IE does not support event capture) stopPropagation: function(ev) { if (ev.stopPropagation) { ev.stopPropagation(); }else { ev.cancelBubble = true; }},// Cancel the default behavior of the event preventDefault: function(event) { if (event.preventDefault) { event.preventDefault(); }else{ event.returnValue = false; }},// Get the event target getTarget: function(event) { return event.target || event.srcElemnt; }, // Get a reference to the event object, get all the information about the event, ensure that the event is always available; getEvent: function(e) { var ev = e || window.event; if(! ev) {var c = this.getEvent.caller; while(c) { ev = c.argument[0]; if (ev && Event == ev.constructor) { break; } c = c.caller; } } retrun ev; }};Copy the code
- [“1″,”2″,”3”]. Map (parseInt)
[1,NaN,NaN] because parseInt takes two arguments (val,radix), where radix denotes the radix used in analysis. Map passed three (element,index,array), the corresponding radix is illegal, resulting in the failure of the analysis.Copy the code
- What is the event? What is the difference between IE and Firefox’s event mechanism? How do I stop bubbling?
(1An action we take in a web page (some actions correspond to multiple events). For example, when we click a button an event is generated. Is behavior that can be detected by JavaScript. (2) event handling mechanism: IE is event bubbling, Firefox supports two event models at the same time, that is: capture event and bubbling event; (3)ev.stopPropagation(); (old ie ev.cancelBubble = true;)Copy the code
- What is a closure and why do you use it?
A closure is a function that has the right to access variables in the scope of another function. The most common way to create a closure is to create another function within a function and access local variables of this function through another function. Closures can be used to break through the scope domain and pass variables and methods inside the function to the outside. // Closure features: (1) nested functions (2) internal functions can reference external parameters and variables (3) arguments and variables are not garbage collected // the onclick event of the li node can correctly pop up the currently clicked li index<ul> <li> index = 0 </li> <li> index = 1 </li> <li> index = 2 </li> <li> index = 3 </li> </ul> <script type="text/javascript"> var nodes = document.getElementsByTagName('li'); for(i = 0; i<nodes.length; i+=1) { nodes[i].onclick = function() { console.log(i+1); // If you do not use closures, the value is 4 each time} (4); } </script>Copy the code
- “Use strict” in JavaScript code; What does that mean? What’s the difference in using it?
Use Strict is an ECMAscript5Added (strict) execution mode, which makes Javascript run under stricter conditions, makes JS code more standardized mode, eliminates some of the Javascript syntax unreasonable, not strict, reduce some of the weird behavior. Bad features that are supported by default are disabled, for examplewith, and cannot assign values to global variables in unexpected cases; Display declarations of global variables. Functions must be declared at the top level. Functions are not allowed to be declared in non-functional code blocks.arguments.Callee is not allowed to use it; Eliminate some of the code to run unsafe, to ensure that the code runs safely, limit the functionargumentsModified in strict modeevalFunctions also behave differently from non-strict modes; Improve the efficiency of the compiler, increase the running speed; Pave the way for future standardization of new versions of Javascript.Copy the code
- What exactly does the new operator do?
(1) creates an empty object andthisThe variable refers to the object and also inherits the function's prototype. (2Attributes and methods are added tothisObject referenced. (3The newly created object is created bythisReferenced, and finally returned implicitlythis 。 // var obj = {}; obj.__proto__ = Base.prototype; Base.call(obj);Copy the code
- In JavaScript, there is a function that performs object lookups and never looks up prototypes. What is that function?
hasOwnProperty //The JavaScript hasOwnProperty function returns a Boolean value indicating whether an object has an attribute with the specified name. This method cannot check whether the property is present in the stereotype chain of the object; The property must be a member of the object itself.//Usage:objectHasOwnProperty (proName) Specifies the parameterobjectIs mandatory, an instance of an object. ProName is mandatory, a string value for the attribute name.//ifobjectHas a property with the specified name, then the JavaScript hasOwnProperty function method returnstrueOtherwise, returnfalse.Copy the code
- Do you know anything about JSON?
JSON(JavaScript Object Notation)Is a lightweight data interchange format. It is based on a subset of JavaScript. The data format is simple, easy to read and write, and occupies little bandwidth. Such as: {"age":"12"."name":"back"}Copy the code
- What is Ajax? How do I create an Ajax?
ajaxThe full name of:Asynchronous Javascript And XML, asynchronous transmission +js+xml. The so-called asynchronous, simply explained here is: when sending a request to the server, we do not have to wait for the result, but can do other things at the same time, until the result itself will follow up according to the Settings, at the same time, the page is not the whole page refresh, improve the user experience.// (1) to create aXMLHttpRequestObject, that is, create an asynchronous call object (2) Create a new oneHTTPRequest, and specify theHTTPMethod of request,URLAnd verification information (3) Set the responseHTTPA function that requests state changes (4) sendHTTPRequest (5) get the data returned by the asynchronous call (6) to useJavaScriptandDOMImplement local refreshCopy the code
- What’s the difference between synchronous and asynchronous?
The concept of synchronization probably comes from the concept of synchronization in the operating system: the order in which different processes work together to accomplish something(blocking, waking up, etc.). Synchronization emphasizes sequence, who comes first and who comes after; Asynchrony does not have this orderliness.//Synchronization: When the browser requests the server, the user sees the page refresh and sends the request again. After the request is complete, the page is refreshed and the user sees the new content and performs the next operation.//Asynchronous: The browser requests from the server. The user performs normal operations and the browser requests from the back end. When the request is finished, the page is not refreshed, the new content will also appear, and the user will see the new content.Copy the code
- How to solve cross-domain problems?
The json, iframe,window.name,windowPostMessage. Set the proxy page on the serverCopy the code
- What do you know about ECMAScript6?
ECMAScript 6Is the next generation standard of the JavaScript language, already in2015years6It was officially released in January. Its goal is to make JavaScript an enterprise-level development language that can be used to write complex, large-scale applications. The standard-setter plans to publish the standard annually, using the year as the version of the standard. Because the current version of ES6 is in2015It is also called ECMAScript2015. In other words, ES6 is ES2015Copy the code
- How does ECMAScript 6 say class and why does it appear?
The ES6classYou can think of it as just a syntactic sugar, and for the most part,ES5You can do it all. NewclassWriting just makes writing object prototypes clearer and more like object-oriented programming syntax. / / define the class class Point { constructor(x,y) { // constructor this.x = x; // This keyword represents the instance object this.y = y; } toString() { return '(' + this.x + ', ' + this.y + ') '; }}Copy the code
- What are the ways to load JS asynchronously?
(1)defer, which only supports IE (2)async: (3) to create ascript, into the DOM, after loading the callBackCopy the code
- What’s the difference between Document. write and innerHTML?
document.writeYou can only redraw the entire page. The innerHTML can redraw a portion of the pageCopy the code
- DOM manipulation – How to add, remove, move, copy, create, and find nodes?
(1Create a new node createDocumentFragment()// Create a DOM fragment createElement() Create a concrete element createTextNode() // Create a text node (2AppendChild () removeChild() replaceChild() insertBefore()// Insert a new child node in front of the existing child node (3) to find the getElementsByTagName ()// Pass the label name getElementsByName() // Pass the value of the element's Name attribute (IE is fault-tolerant, can get an array, including id = Name value) getElementById() // By element Id, uniquenessCopy the code
How to write high-performance JavaScript? Detailed article:A brief introduction to writing high-performance Javascript code
- What operations cause memory leaks?
A memory leak is when any object persists after you no longer own or need it. The garbage collector periodically scans objects and counts the number of other objects that refer to each object if the number of references to an object is0(no other object has referenced the object before), or the only reference to the object is circular, the object's memory is reclaimed.// setTimeoutUsing a string instead of a function as the first argument to the. Closures, console logging, loops (a loop is created when two objects reference and retain each other)Copy the code
How to convert an array to a JSON string in jQuery, and then back again?
JQuery does not provide this functionality, so you need to write two jQuery extensions: $.fn.stringifyArray =function(array) { return JSON.stringify(array) } $.fn.parseArray = function(array) { return JSON.parse(array) } // Then call: $("").stringifyArray(array)Copy the code
- What is the difference between jquery.extend and jquery.fn.extend?
jQuery.extend(object);// Add a static method to your jQuery class jQuery.extend({ min: function(a, b) { return a < b ? a : b; }, max: function(a, b) { returna > b ? a : b; }}); jQuery.min(2.3); // 2 jQuery.max(4.5); // 5Extend (target, object1, [objectN]) extends an object with one or more other objects, returns the extended object jquery.fn.extend (object);// jQuery. Prototype extension to add "member functions" to jQuery classes. Instances of jQuery classes can use this "member function".For example, if we want to develop a plugin that makes a special edit box, when it is clicked, it will alert the content of the current edit box. $.fn.extend({alertWhileClick:function() {$(this).click(function(){ alert($(this).val()); }); }}); $("#input1").alertWhileClick(); $("#input1") is a jQuery instance that extends when it calls alertWhileClick, which pops up the content of the current edit each time it is clicked.Copy the code
- Do you know how to optimize jQuery performance?
The performance of class-based selectivity is expensive compared to Id selectors because you need to traverse all DOM elements.//DOM, which is frequently manipulated, is cached before manipulation. It is better to use Jquery's chain call. Var STR =$();"a").attr("href"); // for (var i = size; i < arr.length; i++) {} forEach loop looks for the array (arR).lengthProperty, which sets a variable to store the number at the start of the loop to make the loop run faster:for (var i = size.length = arr.length; i < length; i++) {}Copy the code
- What is the difference between jQuery and jQuery UI?
JQuery is a JS library that provides functions such as selectors, property modification and event binding.jQuery The UI is inBased on jQuery, using the extensibility of jQuery, designed plug-in. Provides some common interface elements, such as dialog boxes, drag behavior, resizing behavior, and so onCopy the code
- How do I determine whether the script is currently running in a browser or node environment? (ali)
By judgingGlobalWhether the object iswindow, if not forwindowThe script is not currently running in the browserCopy the code
- How to implement thousands separator in JS?
Re + replace function commafy(num) { num = num + ' '; varreg = /(-? d+)(d{3}) /;if (reg.test(num)) { num = num.replace(reg, '$1, $2'); } return num; }Copy the code
- What are the ways to check the browser version?
Function detection, userAgent feature detection such as: Navigator.userAgent / / "Mozilla / 5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36"Copy the code
- Comparison between Canvas and SVG;
| Canvas | SVG | | --------------------------------- | -----------------------------------| |Bitmap technology can be saved as.png|Vector graphics techniques cannot be saved as bitmaps| --------------------------------- | -----------------------------------| |Good at expressing color and line details|Can zoom, not good at detail| --------------------------------- | -----------------------------------| |Web games, statistics|ICONS, charts, maps| | --------------------------------- | -----------------------------------| |One tag (Canvas)+ one object (getContext),| |All graphic images are drawn by CTX|Dozens of labels - one for each image| | --------------------------------- | -----------------------------------| |Cannot be accessed by search engine crawlers yes| --------------------------------- | -----------------------------------| |You can only listen for functions for the entire Canvas binding|Each graph (tag) can be bound to an event listener function| | --------------------------------- | -----------------------------------|Copy the code
-
What do you know about CommonJS, AMD, CMD?
/ / was it | CommonJS | AMD | CMD | |----------|---------|---------| | Node.js |RequireJS| SeaJS |Copy the code
CommonJS AMD CMD UMD
-
Front-end MVC, MVVM 1, MVC
MVC
Model: Data preservation view (View: User interface Controller (Controller) : business logic (1)ViewPass instructions to Controller (2After the Controller completes the business logic, it asks the Model to change state (3)Model sends the new data toViewUsers get feedback that all communication is one-way.Copy the code
2, MVVM
MVVM
Model view (ViewViewModel (ViewModel)1) Two-way communication between the parts (2)ViewThere is no contact with the Model, it is passed through the ViewModel (3)ViewIt is very thin and does not deploy any business logic, which is called PassiveView), that is, there is no initiative; And the ViewModel is very thick, where all the logic is deployed. Using data-binding:ViewChanges to the ViewModel are automatically reflected in the ViewModel and vice versa.Copy the code
- What are HTTP status messages? (such as 200, 302 corresponding description) JS cattle people at home and abroad know what?
Hypertext Transfer Protocol (HTTP) is a communication protocol that allows hypertext Markup Language (HTML) documents to be sent from a Web server to a browser on a client. • "100" : The initial request has been accepted and the client should Continue with the rest of the request. (HTTP 1.1 new) • "101" : Switching Protocols The requester has asked the server to switch Protocols, the server has acknowledged and is ready to switch. (New in HTTP 1.1) • "200" : OK (success) Everything is fine, and the reply documents for GET and POST requests follow. • "201" : Created The server has Created the document, and the Location header gives its URL. • "202" : Accepted The server has Accepted the request, but it has not been processed. • "203" : The non-authoritative Information document has returned normally, but some of the reply headers may be incorrect and may come from another source. (New in HTTP 1.1). • "204" : No Content Is returned. The browser should continue to display the original document. "205" :Reset ContentThere is no new content, but the browser should reset what it shows. To force the browser to clear form input (HTTP 1.1New). •"206":Partial ContentThe server successfully processed part of itGETThe request. (HTTP 1.1New),"300The document requested by the customer can be found in Multiple locations that are already listed in the returned document. If the server wants to propose a preference, it should be indicated in the Location reply header. •"301": Moved Permanently. The requested page has been Permanently Moved to a new location. The server returns this response (as a pairGET 或 HEADThe requestor is automatically transferred to a new location. •"302":Found(temporary move) similar to301, but the newURLShould be seen as a temporary replacement, not a permanent one. Notice that in HTTP1. 0The corresponding status message is Moved Temporatily. When this status code appears, the browser will automatically access the new oneURLSo it's a very useful status code. Note that this status code can sometimes be matched301Use it instead. For example, if the browser requests it incorrectlyhttp://host/~user(missing the trailing slash), some servers return301, and some return302. Strictly speaking, we can only assume that only if the original request isGETIs automatically redirected by the browser. Please see the307. •"303": See Other301/302The difference is that if the original request was POST, the redirected document specified by the Location header should passGETExtract (HTTP 1.1New). •"304":NotThe requested page has not been Modified since the last request. The original buffered document can still be used without returning the web content. •"305":UseProxy Can only be used to access the requested web page. If the server returns this response, the server also indicates which proxy the requester should use. (HTTP 1.1New),"307":TemporaryRedirect and temporary Redirect302(FoundThe same). Many browsers respond incorrectly302The reply is redirected, even if the original request was POST, and even if it can actually only be redirected when the reply to the POST request is303Can be redirected. For this reason,HTTP 1.1A new307To more clearly distinguish between several status codes: when present303When answering, the browser can follow the redirectGETAnd POST requests; If it is307If yes, the browser can only followGETRedirection of the request. (HTTP 1.1New),"400": Bad Request Syntax error occurred in the Request. •"401": Unauthorized A customer attempts to access a password-protected page without authorization. The response contains a www-Authenticate header, which the browser uses to display the user name/password dialog box, and then issues the request again after filling in the appropriate Authorization header. •"403": Forbidden Resources are unavailable. The server understands the client's request, but refuses to process it. This is usually caused by permission Settings on files or directories on the server. •"404":Not FoundThe resource could not be found at the specified location. •"405": MethodNotAllowed (Method Disabled) Request method (GET, POST,HEAD,DELETE, PUT,TRACEEtc.) disable. (HTTP 1.1New),"406":NotThe Acceptable resource has been found, but its MIME type is not compatible with that specified by the customer in the Accpet header (HTTP 1.1New). •"407": the ProxyAuthentication Required(Requires agency authorization) similar to401Indicates that the client must be authorized by the proxy server. (HTTP 1.1New),"408": the RequestTime-outThe server timed out while waiting for the request. (HTTP 1.1New),"409": Conflict is usually associated with PUT requests. The request cannot succeed because it conflicts with the current state of the resource. (HTTP 1.1New),"410": Gone (deleted) The server returns this response if the requested resource has been permanently deleted. The code and404The (not found) code is similar, but is sometimes substituted in cases where the resource was once present but now no longer exists404Code appears. If the resource has been permanently deleted, then you should use it301The code specifies a new location for the resource. (HTTP 1.1New),"411":Length RequiredRequests containing invalid content-length header fields will not be accepted. (HTTP 1.1New),"412": the PreconditionFailed(Conditions not met) The server does not meet one of the conditions set by the requester in the request. (HTTP 1.1New),"413": Request Entity TooLarge(Request entity is too large) The request entity is too large to handle. If the server thinks it can process the request later, it should provide a Retry-AfterHead. (HTTP 1.1New),"414": the Request URI TooLarge(Request URI too long) The request URI (usually the url) is too long for the server to process. •"415": Unsupported MediaTypeUnsupported media Types The requested format is not supported by the requested page. •"416": the Requestedrange notSatisfiable: The server cannot satisfy the customer specified in the requestRangeHead. (HTTP 1.1New),"417": the ExpectationFailedThe server did not meet the requirements for the "expected" request header field. •"500": the InternalServer Error(Server internal error) The server encountered an error and could not complete the request. •"501":NotThe Server is not equipped to fulfill requests. For example, the server might return this code when it cannot recognize the request method. •"502": Bad Gateway When a server, acting as a Gateway or proxy, accesses the next server to complete a request, but the server returns an invalid reply. •"503": Service Unavailable The server did not respond due to maintenance or heavy load. Usually, this is just a temporary condition. •"504": the GatewayTime-out(Gateway timeout) Used by a server acting as a proxy or gateway to indicate that a reply cannot be received from the remote server in a timely manner. (HTTP 1.1New),"505":HTTP Version notSupported (HTTPVersion not supported) used in the request is not supportedHTTPProtocol version. Domestic cattle: Taobao UED official blog. Ling Yu, big into small fat, Cheng Yu, pull redCopy the code
CSS3 Front-End development interview questions summary — JAVASCRIPT (2) Front-end development interview questions summary — JAVASCRIPT (3)
All the above information comes from the network, if there is any wrong place, please timely inform, welcome everyone criticism and correction!
Did this article help you? Welcome to join the front End learning Group wechat group: