The shorthand for JavaScript developers
This article is based on years of JavaScript coding experience and is suitable for all developers who are using JavaScript programming.
The purpose of this article is to help you more skillfully use the
I. Error Classification
1. syntax error: it is also called a parsing error. It occurs during compilation in traditional languages and occurs in JavaScript during interpretation. These errors are directly caused by unexpected characters in the Code
This article describes how to implement the TwoQueues cache model in JavaScript. For more information, see the TwoQueues cache model described in this article.
Regardless of the language, some data may need to be stored in the memory to avoid
Router ()A router is an isolated middleware and an instance of a route. A router can be considered a "mini" application and can only execute middleware and routing options. Every express program will have a built-in application router.The router
1.Promise IntroductionPromise is the first community proposed and implemented, the latter ES6 to write to the standard, and the original Promise object, is an asynchronous programming solution, the specific concept you can go to view the relevant
Today accidentally saw a lexical new.target!What's this thing? In my mind, the new heel is a constructor! What the hell is this?Let F = function f () { if (!new. Target) throw new Error (' ... ') // }; Check it out and find out what it
From the whole point of view, the implementation of Q is actually a closure of the application, the following simple explanation of the basic function of Q.
GitHub Q's APIRealize the function of Q, first understand the API of QThe documentation
Php creates a short IDCreateshortIDswithPHP-LikeYoutubeorTinyURL ?? MoreisLess-themathThealphabethas26characters.Thatsalotmorethan10digits.Ifwealsodisti php Create short ID Create short IDs with PHP-Like Youtube or TinyURL
?
?More is Less-the
Simply put, an object (before learning design patterns, need to understand the object-oriented thinking) is only responsible for a specific task;
Singleton class:
1. The constructor needs to be marked as private (access control: Prevent external
This article mainly introduces the relevant information of the small program SocketIO. Here we provide you with a simple example. if you need it, you can refer to the next article to introduce the relevant information of the small program SocketIO,
This is a creation in
Article, where the information may have evolved or changed.
With the growth of the mobile side, today's RESTful API is already popular,In various languages to write back-end API has a very mature and convenient solution, with
This article mainly introduces exception capture in JavaScript. This article explains how to throw an exception by throwing a throw statement and capturing an exception by trycatchfinally statement. For more information, see the same Java language,
The current PHP has been released to version 7.
I've been studying it for the last two days.
Now the new error handling and exception handling methods are not very clear how to use
I hope the great God can give an example
try {
//1. Create an Ajax object//var xhr=new xmlhttprequest;//var xhr=null;//try{//if (window. XMLHttpRequest) {//xhr=new XMLHttpRequest;//}else if (new ActiveXObject ("Microsoft.XMLHTTP")) {//xhr=new ActiveXObject ("Microsoft.XMLHTTP");//}else if (new
Why is async required? Why Look at a piece of code.Question 1:
for (Var i=0;i
}
Alert (' Hello world!!! ');
This code means to do 100 ... After the next implementation of alert, the problem is that seriously blocked the
Promise in JS
callback function The real problem is that he deprives us of the ability to use return and throw these keywords. And Promise a good solution to all this.
In June 2015, the official version of ECMAScript 6 was finally
Grammar:try{ //Run code here} catch(err) { //handling errors here}Note: Try...catch uses lowercase letters. Uppercase letters make an error.In JavaScript you can use Try...catch to do exception handling. For example:try {foo.bar ();} catch (E)
ways to avoid browser responses to JavaScript errors:1. Use the Try-catch statement where the error may occur.2, use the Window.onerror event processing statement, this way can accept all the errors Try-catch can not handle (ie, Firefox and Chrome
JavaScript is nothing more than introducing the script tag to the page. But when the project grows, N JavaScript codes are introduced to a single page. merging a single file reduces the number of requests, however, the requested file volume is large.
Common DOM sorting
Js has a lot of cross-browser pitfalls in DOM operations. This article takes me nearly a week to organize, and I will sort out the big and small pitfalls Based on the instances ".
Preface:
Html builds a DOM tree for the document,
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.