Javascript implementation perfect inheritance

javascipt There are three aspects to realize the perfect inheritance of javascript: Step 1: get the properties in the body of the parent constructor Solution: through the family. Call (this) (in this case, this is the sub constructor) Step 2: create an independent child constructor prototype according to the parent const ...

Posted on Fri, 03 Apr 2020 22:03:03 -0400 by eddjc

How to traverse the tree through JavaScript

The tree is basically a fancy list of links, and it's very easy to create and delete nodes on the tree. On the other hand, when they are not sorted, the search will be a little tricky, so we will study several different ways to deal with the whole tree search. Precondition You will need a basic understanding of what trees are and how they wor ...

Posted on Fri, 03 Apr 2020 21:05:10 -0400 by mistercoffee

Advanced HTML5 game development 4: physical engine integration

First, add objects to the level, perform Box2D physical simulation on these objects, and then let them move in the game. We will use these objects to create test levels and add mouse interaction to make the game truly playable. Finally, add sound effects and background music to the test level to make a complete game. 4.1 defining objects Load ...

Posted on Fri, 03 Apr 2020 20:52:37 -0400 by ondemand

Write your own Web front-end framework

"Happy new year first!" Preface Recently, I have been watching the live broadcast of Alibaba's front-end p6 architect training program of Brain Institute. Yesterday was a wonderful one. It's about a set of architectures, which are called "driver frameworks.". Let's summarize today. Some sk ...

Posted on Fri, 03 Apr 2020 12:17:17 -0400 by cordex

Let blog Park automatically generate directories and return to the top

If there is a directory for a blog post, it will be convenient not only for yourself but also for readers. Here are my blog settings. Automatically generate catalog effects Back to the top Set build directory and return to top method You need to have Js permission first, and then copy the code. It's very simple (1) Footer html code ...

Posted on Fri, 03 Apr 2020 10:48:16 -0400 by everlifefree

Communication between Vue non parent and child components

There are several ways to achieve communication between non parent and child components Bus bus. Create an empty Vue object as the bus central event bus (intermediate component). vuex (suitable for large projects, not obvious for small projects) provide/inject Local storage The first one is the most commonly used one. Only the first o ...

Posted on Fri, 03 Apr 2020 07:56:13 -0400 by rahnel

ckeditor + ckfinder + oss storage

There are many integration methods of ckeditor and ckfinder on the Internet. I won't talk about them here. (it's mainly about the 0.0 integrated before, but now I forget how to make it.)   I use js code directly after integration here <script type="text/javascript"> CKEDITOR.replace('content', { filebrowserBrowseUrl: '__SYST ...

Posted on Fri, 03 Apr 2020 05:14:45 -0400 by Gulsaes

Wechat applet order plug-in (calendar)

Recently, I developed a small program, which is similar to the calendar plug-in of hotel reservation for the sake of hands-on and work needs.First, the graph;   This plug-in is divided into two parts: the upper part is the tab column, which will automatically locate to the current according to the current date, and display the next 7 days' date ...

Posted on Thu, 02 Apr 2020 23:49:51 -0400 by mark_c

JavaScript variable declaration var,let.const

The scope of a var declaration variable is limited to the context of its declaration location var x = 0; // x Is a global variable with a value of 0. console.log(typeof z); // undefined,because z It doesn't exist yet. function a() { // When a When called, var y = 2; // y Declared as a function a The variable of the scope is then assign ...

Posted on Thu, 02 Apr 2020 23:29:48 -0400 by jogisarge

HTML mouse and keyboard events and objects

HTML mouse and keyboard events and objects 1. incident 1.onclick -- click event 2.ondblclick -- double click event 3.onmousedown -- mouse down event 4.onmouseup ---- mouse up event 5.onmousemove -- mouse move event 6.oncontextmenu -- right click event 7.onmouseover --- mouse move in event 8.onmouseout ---- ...

Posted on Thu, 02 Apr 2020 20:33:44 -0400 by noirsith