FileReader gets the BASE64 code of the picture and previews it
FileReader gets base64 code of picture and previews it
FileReader, to be honest, I'm not familiar with it. It's just a record of usage here.
Method name
parameter
describe
abort
none
Interrupt read
readAsBinaryString
file(blob)
Read file as binary
readAsDataURL
file(blob)
Read file as DataURL
readAsText
fil ...
Posted by RazorICE on Tue, 31 Mar 2020 09:23:34 -0700
Native js implements Ajax requests, including get and post
Now the web requests data from the server, many of which use Ajax, but they are all wrapped with JQuery. In the previous project, because JQuery cannot be referenced, it can only be used in the native, not to speak much, please see the code.
1 /*-------------------Ajax start--------------------*/
2
3 function ajax(options) {
4 options ...
Posted by bernouli on Tue, 31 Mar 2020 01:09:43 -0700
vue sub component transfers data to parent component (example of adding and subtracting)
Here's a common way for a subcomponent to pass values to its parent. Here is an example of addition and subtraction to explain the principle.
As shown in the figure below:
The value of the parent component is 0 when there is no operation
When the plus sign is clicked, the value of the parent component is 1
When you ...
Posted by sinbad on Tue, 31 Mar 2020 00:31:29 -0700
Three common binding event methods in JS
In the study of JavaScript, we often encounter the event mechanism of JavaScript, such as event binding, event listening, event delegation (event agent), etc. What do these nouns mean and what are their functions?
Event binding
To make JavaScript respond to user actions, you first bind event handle ...
Posted by theycallmepj on Tue, 17 Mar 2020 02:55:45 -0700
Transition & Animation of Vue
Transition & Animation of Vue
transition
When Vue inserts, updates, or removes DOM, it provides a variety of application transition effects.
Vue provides a built-in transition encapsulation component that wraps the components to achieve the transition effect.
Grammatical format
<transition ...
Posted by gmann001 on Mon, 16 Mar 2020 05:07:01 -0700
Events in js
Events in js
Events in javascript can be understood as an interactive operation in HTML documents or browsers.
1, How to bind events
1. Inline
This mode is the most traditional way to handle events. In the inline model, the event handler is an attribute of the HTML tag that handles the specified e ...
Posted by MikeSnead on Sat, 07 Mar 2020 02:20:18 -0800
Front end learning - carousel chart case
Article directory
Preface
Import jQuery function library
Rotation chart
requirement analysis
Realization
css
html
Development process
html framework development
Style development
Dynamic page generation
summary
Preface
Last article: Front end learning (3) - jQuery function library
The last ...
Posted by skissiks on Tue, 03 Mar 2020 20:58:21 -0800
249. Responsive layout of bootstrap (grid system)
Responsive layout#
I. purpose: the same set of pages can be compatible with devices of different resolutions.
2. Implementation mode: using grid system to achieve:
A row is divided into 12 squares. You can set an element to occupy several squares according to the size of the screen.
III. steps:
Step ...
Posted by antonello on Tue, 25 Feb 2020 20:06:38 -0800
The usage and source code analysis of three java thread Synchronizers
Functions of three Synchronizers
This paper mainly introduces three thread synchronizers, their functions are as follows:
CountDownLatch: make sure that all sub threads are summarized after execution. There is a counter inside. After execution of a sub thread, count down and return;
CyclicBarrier: a ...
Posted by biocyberman on Mon, 24 Feb 2020 06:10:07 -0800
JavaScript to achieve magnifier effect (including throttling)
requirement analysis
It is required to make a magnifying glass as shown in the figure, with mouse following, turning on and off when right clicking, including transition animation.
The general idea is to bind mouse events and dynamically modify the background position. The difficulty lies in that the ...
Posted by myharshdesigner on Tue, 18 Feb 2020 04:56:57 -0800