JavaScript Develops Common Tool Functions
1. isStatic: Detecting whether the data is original except symbol s
function isStatic(value) {
return(
typeof value === 'string' ||
typeof value === 'number' ||
typeof value === 'boolean' ||
typeof value === 'undefined' ||
value === null
)
}
2. isPrimitive: Detecting whether the data is ...
Posted by xcmir on Tue, 23 Jul 2019 20:56:19 -0700
More quickly to help you understand React - higher-order components
When it comes to react, the first thing we think of should be components. In react's eyes, everything is components. Even axios, which we use to get data, can be represented by components... for example, we can encapsulate them in this way.
<Request
instance={axios.create({})} /* custom instance of axios - optional */
method="" /* get, d ...
Posted by Plug-in on Sun, 21 Jul 2019 23:22:26 -0700
Part 4: Implementing a set of ui component library of vue on pc side from scratch (button component 2)
Episode 4: Implementation from scratch (button component 2)
Location of this episode: I've been busy with other things before, but now I'm finally free to write about this library. The purpose of this article is to carry on the above and realize the function of button component.
1: Add icon to button The icon of the button is very important ...
Posted by MishieMoo on Sat, 20 Jul 2019 23:03:52 -0700
Things about WebSocket
Push TechnologyBy establishing a long connection between the client and the server, the client can receive messages sent by the server from time to time.
(1) polling method based on ajax:
Using JQuery encapsulated $. ajax to build polling is shown below, and the polling is conducted every five seconds, regardless of whether the request is succe ...
Posted by jabapyth on Fri, 28 Jun 2019 14:01:38 -0700
Implementation of Watermarking Items and Selection of Two Implementation Schemes
We propose two solutions for watermarking project 1. Implementation with shadow dom
1. Basic Ideas
By attach Shadow, a shadow root node is generated, and then a watermarking is added under the root node through a circular statement. The position is used to layout the absolute and make it full of containers.
show me the code:
(function (ro ...
Posted by wheakory on Thu, 20 Jun 2019 13:41:03 -0700
CSS Learning Notes - CSS Selector
Selector defined in CSS1
Type Selectors
Used to select an element of a specified type (in fact, it is the html tag selector), the common usage is as follows:
body {
/*Define styles for body elements*/
}
body,div {
/*Choose multiple label elements at the same time*/
}
ID selector
The html elements used to select the specified ID are as ...
Posted by icarpenter on Wed, 19 Jun 2019 15:30:53 -0700
Draw a water polo with canvas
The sample code is hosted in: http://www.github.com/dashnowords/blogsBlog Garden Address: The original bibliography of Dashi Living in the Big Front End
Huawei Cloud Community Address: [Guidelines for Upgrading Your Front-end Crackers]
[TOC]
I. Mission Statement
Using the native canvas API to draw a water polo map will be an interesting chall ...
Posted by kevinfwb on Wed, 19 Jun 2019 12:53:04 -0700
Page Layout Solution
Page Layout Solution
Centralized layout
horizontally
The child element is in the middle relative to the parent element and the width of the child element is variable.
In addition to other declarations, the HTML structure is as follows:
<div class="parent">
<div class="child">Demo</div>
</div>
inline-block + text-alig ...
Posted by bonaparte on Sat, 08 Jun 2019 14:20:28 -0700
Detailed and Example of HTML5 Drag and Drop
brief introduction
Drag-and-drop is a common feature, which is to drag an object to another location after grabbing it.
In HTML5, drag and drop is part of the standard, and any element can be dragged and dropped.
First click on a small example: execute JavaScript when the user starts dragging < p > elements
<p draggable="true" ondragst ...
Posted by BinaryDragon on Fri, 07 Jun 2019 15:49:50 -0700
HTML5 API FormData -- Using
FormData
brief introduction
XMLHttpRequest Level 2 adds a new interface FormData. Using FormData objects, we can use JavaScript to simulate a series of form controls with some key-value pairs. We can also use the send() method of XMLHttpRequest to submit this "form" asynchronously. Compared with ordinary ajax, the greatest advantage o ...
Posted by ignite on Wed, 05 Jun 2019 16:01:09 -0700