Simple implementation of jQuery toaster prompt

Note: in school, the usual small project page skipping is to use Response.Write script to pop up and page skipping. Every time you click login success, registration success... Then click OK, it's too troublesome. The project teacher said to use this plug-in, so it's easy to do it! Implementation effect: when you click login, you can query throu ...

Added by creatives on Tue, 03 Dec 2019 18:32:10 +0200

Advanced optimization of bubble sorting

The idea of bubble sorting: we take ascending sorting as an example. The so-called bubble sorting is to select the largest number in each run in an unordered array and put the next largest number in the second run in the last place until the sorting is completed. And so on Descending is to sort small numbers after them. The code is as follows: ...

Added by timgetback on Tue, 03 Dec 2019 13:24:02 +0200

js common calculation

Due to the problem of calculation accuracy, for example, 0.1 + 0.2 = 0.3000000000000004, the following methods need to be sorted out to facilitate simple calculation. The main idea is to convert to integer first, then to calculate, and then to return to floating point number after calculation Getting decimal places and moving decimal places to ...

Added by calabiyau on Tue, 03 Dec 2019 08:25:57 +0200

Notes arrangement of React beginner study -- Introduction and syntax of JSX

Let's look at this code first: import React from 'react'; //In the final rendering, you need to call the react DOM library to render jsx to all pages import ReactDOM from 'react-dom'; import * as serviceWorker from './serviceWorker'; let h = <React.Fragment> <h2>hello</h2> <ul></ul> </React.Fragment ...

Added by ihcra on Tue, 03 Dec 2019 03:34:20 +0200

Solve the problem that ClipboardJS fails to copy on iphone through textarea tag

Some time ago, I did the function of wechat custom sharing. There was a problem that the invitation code of the shared page failed to be copied on ios mobile phone, but there was no problem on PC and Android. Baidu for a moment, the basic solution is: ios does not simply support on, for the click elements to add empty click event: onclick = &qu ...

Added by nickminute on Mon, 02 Dec 2019 21:12:06 +0200

[algorithm] - 6. Hill sorting

Algorithm Introduction The core of hill sorting lies in the setting of interval sequence. The interval sequence can be set in advance or defined dynamically. The algorithm of defining interval sequence dynamically is proposed by Robert Sedgewick, coauthor of algorithm (4th Edition). Algorithm description and Implementation ...

Added by theonlydrayk on Mon, 02 Dec 2019 19:55:16 +0200

TP5 implements Ajax to get the page and render it

It is easy to realize module segmentation of HTML page by using MVC mode of thinkph5, and asynchronous refresh of some pages can be realized by using Ajax technology, so that Web level APP -- main page frame, CSS style, Javascript file, etc. can be loaded only once; according to the actual needs of users, the required files can be ...

Added by mcclellanfsu on Mon, 02 Dec 2019 18:29:41 +0200

javascript's research on deep copy objects

For deep copy, the concept of shallow copy is not much said, the concept can be Baidu yo! Here are some research on deep copy objects! Only deep copy of value type data For data objects with only values, the following line is enough! JSON.parse(JSON.stringify(obj)) A simple, unstructured, deep copy function clone(source) { var target = {}; ...

Added by insight on Mon, 02 Dec 2019 11:57:50 +0200

jQuery ---- implementation of left navigation bar panel switch

Page run results:                                                      Click Cao Cao, click Liu Bei, click Sun Quan Requirement Description: as shown in the original figure, when you click on one of the princes, it shows the strong generals of the princes, and the strong generals of the other princes are hidden   Page structure:   Implementati ...

Added by quad on Mon, 02 Dec 2019 10:22:17 +0200

JavaScript function definition, parameter call

I. JavaScript functionsFunction: a function is an encapsulation, event driven, or reusable block of code that executes when it is called.Define function:Function function name (){Function body;}The number will not be automatically executed. It needs to be called before it can be executedFunction name ();Function naming rules:Consistent with var ...

Added by Kookedoh on Mon, 02 Dec 2019 06:55:12 +0200