js base64 and canvas base64

1, js base64 Get the uploaded file myfile, create a fileRead file object, and use the readAsDataURL method to encode the read file into a Data URL. After the file is loaded successfully, e.target.result is the base64 encoding corresponding to the file image. The image can be displayed by assigning the src of img directly. <body> & ...

Posted by hardius on Fri, 01 May 2020 14:42:21 -0700

Using Tencent location service for mobile location

1. First, write a tool class to locate the function in common.js common.js: //Location service function entry function getLocationInfo() { if (localStorageUtils.acquireLocationInfo() == null ||localStorageUtils.acquireLocationInfo().curLongitude == null || localStorageUtils.acquireLocationInfo().curLatitude == null) { getCurrentL ...

Posted by bradles on Fri, 01 May 2020 13:19:07 -0700

Three.js promotion learning 2: building the basic components of three.js scenario

The learning content of this article comes from Three.js Development Guide: JavaScript 3D Library of WebGL Create scene There are three types of components needed for a scenario to display anything: assembly Explain video camera Decide what needs to be rendered on the screen light source Determines how materials are displayed a ...

Posted by johnc71 on Fri, 01 May 2020 10:18:30 -0700

2018-01-06 deep copy and shallow copy of javascript

catalog: What is replication? A simple shallow copy An example of deep replication Several general methods of deep and shallow replication Deep copy What is replication? Simple variable replication, small memory, we can directly copy without reference. First, deep copy and shallow copy are only for complex objects such as object and arra ...

Posted by kcorless on Fri, 01 May 2020 08:28:23 -0700

Object traversal method

Different return values of different methods traversing objects Pre Code: function Obj() { // Add properties directly on this this.prop_this = 'prop_this'; // Add symbol attribute on this this[Symbol.for('prop_symbol')] = 'prop_symbol'; } // Add attribute on Prototype Obj.prototype.propProto ...

Posted by kenle on Fri, 01 May 2020 04:13:47 -0700

Example used by JSONP and artTemplate template template engine -- request weather data

Example used by JSONP and artTemplate template template engine - Request weather data The first two articles briefly summarize The principle of cross domain request in jsonp , and The use of artTemplate template engine . So make a simple example of requesting weather. I don't know why. Yesterday's request for Baidu ...

Posted by praxiz on Fri, 01 May 2020 00:19:29 -0700

vue can't use El input of element UI to monitor the carriage return event

From: http://blog.csdn.net/u014520745/article/details/71746343 Only for learning, not for business!!! vue can't use El input of element UI to listen to the carriage return event. The reason is that the original event is hidden after the element UI itself encapsulates a layer of input tag. Therefore, the following code runs unresponsive: ...

Posted by johlwiler on Thu, 30 Apr 2020 17:33:46 -0700

Source code analysis of v-1.8.2 under core

V-1.8.2 source code analysis of anderscore (2) if(typeof exports !== "undefined") { if(typeof module !== "undefined" && module.exports) { exports = module.exports = _; } exports._ = _; } else { root._ = _; } Assign the local variable defined above to the property in the global objec ...

Posted by crackfox on Thu, 30 Apr 2020 11:59:38 -0700

Basic use of AMD - requireJS in JavaScript modular programming

AMD of JavaScript modular programming requireJS basic use Tags (space delimited): JavaScript Reference article AMD specification AMD is the abbreviation of "Asynchronous Module Definition", which means "Asynchronous Module Definition". It loads the module asynchronously, and the loading of the module does not affect the ru ...

Posted by nlhowell on Thu, 30 Apr 2020 07:59:20 -0700

Simple learning of JavaScript (Collection 1) tutorial, introduction, usage, output

Collection 1 tutorial, introduction, usage Catalog Introduction to the collection 1 tutorial usage Catalog 1 tutorial 2 Introduction 3 usage 1 tutorial <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Rookie tutorial(runoob.com)</title> <script> f ...

Posted by mr_zog on Thu, 30 Apr 2020 00:10:55 -0700