Cookies and localStorage

Distinction and Practice of Local Storage, Cook and Session Storage 1. Cookie cookies. Its size limit is about 4KB, invented by Lou Montulli, a former employee of Netscape in March 1993. Its main purpose is to save login information, such as you can see "remember passwords" when you log into a website market, which is usually achieve ...

Posted on Mon, 19 Aug 2019 20:15:32 -0700 by supinum

From knowing Hash and Html5 History to simply implementing routing

Hash The hash attribute is a readable and writable string, which is the anchor part of the URL (starting with the #), and hash in the page has a variety of functional meanings: Anchor point url: http://www.example.com/index.html#jump dom: <a name="jump"></a> perhaps <div id="jump" > After reading hash, the browser automaticall ...

Posted on Tue, 06 Aug 2019 18:11:09 -0700 by keiran420

Python 3 implementation of binary tree traversal and recursive algorithm analysis

Python 3 implementation of binary tree traversal and recursive algorithm analysis 1. Three traversal modes of binary tree There are three traversal modes of binary tree: first traversal, middle traversal, and subsequent traversal, that is, middle traversal refers to the order of accessing the root node eg: left-right-left-right-right-left-right ...

Posted on Sat, 03 Aug 2019 05:09:25 -0700 by schoi

"Let me help you Baidu" source code

Preface Yesterday, I saw a very interesting website in the Wechat group, that is, to input the questions I want to input, and then help you generate a link. After you visit, you will automatically jump to the corresponding Baidu link. This website is not difficult to implement, but just very interes ...

Posted on Wed, 31 Jul 2019 20:16:34 -0700 by Nytemare

Using event proxy to get one of multiple tags/images in an event

Scenario: A navigation bar/picture drop-down box on a page with multiple identical label nodes that can capture a click and encapsulate the corresponding method function (without considering IE)Steps to consider:(1) The Principle of Event Agent (Event Bubble)(2) Several points to consider in a function (default behavior, this pointing) 1. Even ...

Posted on Tue, 30 Jul 2019 21:53:11 -0700 by adityamenon90

Use of five different values of CSS position

position attribute The position attribute specifies the type of positioning method (static, relative, fixed, absolute or sticky) used for elements. There are five different values: static relative fixed absolute sticky Then use top, bottom, left, and right attributes to locate elements. However, these attributes will not work unless th ...

Posted on Mon, 29 Jul 2019 00:44:55 -0700 by daedalus__

Encapsulating some useful methods

1. Enter a value and return its data type function type(para) { return Object.prototype.toString.call(para) } 2. Array de-weighting function unique1(arr) { return [...new Set(arr)] } function unique2(arr) { var obj = {}; return arr.filter(ele => { if (!obj[ele]) { obj[ele] = true; return true; ...

Posted on Sun, 21 Jul 2019 20:34:41 -0700 by neo777ph

Java Basic Tutorial - Thread State

Thread state JAVA defines six thread states: Thread.State public enum State { NEW, RUNNABLE, BLOCKED, WAITING, TIMED_WAITING, TERMINATED; } Namely: New State ____________ NEW RUNNABLE Blocking state. BLOCKED Infinite Waiting State WAITING Sleeping state. TIMED_WAITING State of Death. TERMINATED Threads cannot run all the time ...

Posted on Fri, 12 Jul 2019 14:05:57 -0700 by satanclaus

Implement cross-browser use of events

Event Objects in BOM DOM-compliant browsers pass an event object into the event handler.Regardless of the 18 methods used when specifying event handlers (DOM0 or DOM2), an event object is passed in.Take the following example. var btn = document.getElementById("myBtn"); btn.onclick = function(event){ alert(event.type); //"cli ...

Posted on Sun, 07 Jul 2019 10:08:15 -0700 by phpwiz

10.2 DOM Operational Technology [JavaScript Advanced Programming 3rd Edition]

Many times, DOM operations are more concise, so it is not cumbersome to generate content in JavaScript that would normally have been generated using HTML code.However, there are times when operating a DOM is not as simple as it might seem on the surface.Because browsers are full of hidden traps and incompatibilities, it is more complex to proce ...

Posted on Wed, 03 Jul 2019 10:30:10 -0700 by rd2010