CORS detailed explanation and treatment method
CORS detailed explanation and treatment method
reference resources: http://javascript.ruanyifeng.com/bom/cors.html
CORS (cross origin resource sharing): cross source resource sharing allows browsers to send XMLHttpRequest requests to from different sources, which overcomes the limitation that ajax can only be used from the same source.
Moder ...
Posted by cheechm on Thu, 30 Sep 2021 17:12:14 -0700
ECharts from introduction to advanced 6000 words long, with pictures and texts
Echarts quick start
Import the echorts.js filePrepare a box to present the chartInitialize the ecarts instance objectPrepare configuration itemsSet the configuration item to the ecarts instance object
<div style='width: 600px; height: 400px;'></div>
<script src="./lib/echarts.js"></script>
<script>
// Initializ ...
Posted by skyer2000 on Thu, 30 Sep 2021 16:25:07 -0700
Some common interview questions
1. Find the largest value in the array, arr = [7,4,8,1,5]
console.log(Math.max(7,4,8,1,5));
console.log(Math.max.apply(1,arr));
2. Encapsulate a function to generate n-bit random verification code
function randomCode(num) {
var str = '0-9a-zA-Z';
var arr = '';
for (var i = 0; i < num; i++) {
...
Posted by shoz on Thu, 30 Sep 2021 15:27:54 -0700
The context of the function - that is, the problem of this pointing in the function
Last time, we introduced two rules in the "function context" this pointing problem
① 1.2 rule 1 : Execute directly with parentheses, and the context is a window object
② 1.2 rule 2 : The context is the object or number that is called from the object or enumerated in the array. group
Let's continue to introduce some o ...
Posted by senorfrog on Wed, 29 Sep 2021 21:43:06 -0700
Touch your hand to teach you Taro+dva+Hooks to quickly develop small programs
Recently, in the research of small programs, we used Jingdong React based small program development framework Taro. Compared with mpvue and uni app, Taro is more elegant and stable. Big factories are iterating, but it is different. In a word, there are fewer pits ~
Pre knowledge
Before reading this tutorial, you need to master the developme ...
Posted by jesse_james on Wed, 29 Sep 2021 19:59:16 -0700
Timer Basics (32)
* Timer: set a timer and set the waiting time. When the execution time is reached, the browser will execute the corresponding method
*
* [common timer]
* setTimeout([function],[interval])
* setInterval([function],[interval])
*
* [function]: the method ...
Posted by mzm on Wed, 29 Sep 2021 13:15:33 -0700
Consolidate common array methods
Common methods of traversing arrays
1. forEach
Note: forEach is the simplest and most commonly used array traversal method. It provides a callback function that can be used to process each element of the array. By default, there is no return value. The parameters of the callback ...
Posted by itsmani1 on Wed, 29 Sep 2021 11:41:57 -0700
Prototype development method + inheritance
Prototype development method + inheritance
Methods on extended prototypes
Extension of array indexOf
// console.log(Array.prototype.indexOf);
// Return function in standard browser, and return undefined in IE8 and
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function (val, index) {
index = typeof index === 'undefine ...
Posted by MicahCarrick on Wed, 29 Sep 2021 11:17:36 -0700
Common methods for arrays - (Regret series aside, what novices need to know)
Common methods of arrays
Array.length
length is an instance property of Array that returns the number of elements in the array and is always greater than the subscript of the last item in the array
let arr = [1, 2, 3, 4]
console.log(arr.length) // 4
indexOf
indexOf('ele',fromIndex) Parameter 1: Elements of the query Parameter 2 (optional) ...
Posted by xionfoo on Wed, 29 Sep 2021 09:58:02 -0700
HTML5 final assignment: red wine theme website design - simple red wine introduction web page (7 pages) HTML+CSS+JavaScript
HTML5 final assignment: red wine theme website design - brief red wine introduction web page (7 pages) HTML+CSS+JavaScript final assignment HTML code student web page course design final assignment Download Web page design and production finished products
Common web design topics include individuals, food, companies, schools, tourism, e-com ...
Posted by jsucupira on Tue, 28 Sep 2021 21:01:01 -0700