Lenix

The easiest way to get cookies in JS

const getCookie = (name) => document.cookie.match(`[;\s+]?${name}=([^;]*)`)?.pop(); // For example, the cookie is as follows: a=b; c=d // use getCookie(‘c’) // d where match is the prototype method for strings. str.match(regexp) If a non-regex object is passed in, it is implicitly converted to a RegExp using new RegExp(obj) The above, so there is no need to […]

The easiest way to get cookies in JS Read More »

Next.js 13 Released, Launching a 700x Faster Rust-Based Webpack Alternative

Next.js 13 is out now and some of the highlights include: app/Directory (beta): Simpler, faster, less client-side JS. Layouts React Server Components Streaming Turbopack (alpha): A 700x faster Rust -based alternative to Webpack. New next/image (stable) : native browser lazy loading faster. New @next/font (beta) : Automatic self-hosted font with zero layout offset. Improve next/link:

Next.js 13 Released, Launching a 700x Faster Rust-Based Webpack Alternative Read More »

Tomcat: Basic Installation and Usage Tutorial

This article records the basic usage of Tomcat , mainly to strengthen memory. installation steps Step 1: Download and Install Java Download address: http://www.oracle.com/technetwork/java/javase/downloads/index.html . Install and set the JAVA_HOME environment variable: Step 2: Download and unzip Tomcat Download address: http://tomcat.apache.org/ . Step 3: Modify the port number .NET I use 80xx, Php I use

Tomcat: Basic Installation and Usage Tutorial Read More »

Drag and drop elements from the iframe to any position on the upper page.

iframe code: json <!doctype html> <html> <head> <meta charset=”utf-8″> <title>HTML document</title> <meta name=”keywords” content=””> <meta name=”description” content=””> </head> <body> <div draggable=’true’ id=”hahaha” class=”box”> ddddd </div> <div draggable=’true’ id=”hahaha2″ class=”box”> ddddd </div> <script> /** Iframe code **/ //say you have this div inside … The post drags and drops elements from the iframe to anywhere on

Drag and drop elements from the iframe to any position on the upper page. Read More »

web client storage

Modern web browsers offer many ways to store data on the web client of the user’s computer – with the user’s permission – and retrieve it when it needs to. This allows you to keep your data for a long time, save sites and documents for offline use, preserve your personal configuration for your site,

web client storage Read More »

IndexedDB API

indexedDB is a low-level API for client-side storage of large amounts of structured data, including files/blobs. This API uses indexes to enable high-performance searches on this data. While Web Storage is useful for storing small amounts of data, it is less useful for storing large amounts of structured data. IndexedDB provides a solution. This is

IndexedDB API Read More »

An article to understand JS asynchronous programming, detailed explanation of callback, Promise, Generator, async/await usage

JavaScript is a single-threaded programming language that requires an asynchronous approach to achieve high performance. However, asynchronous programming is often confusing when you are just starting to learn. What is synchronous/asynchronous For example: if now you need to do two things, boil water and eat. So how do you allocate your time? Method 1: Boil

An article to understand JS asynchronous programming, detailed explanation of callback, Promise, Generator, async/await usage Read More »