October 2022

Modern way to defer CSS and JavaScript resources to improve page load speed

To improve page load speed, you can defer CSS and JavaScript resources by adjusting only the HTML code of the page. Delay CSS delayed media Delay JavaScript Resources such as CSS, fonts, and JavaScript are considered render-blocking . This means that the browser needs time to load page content before it actually renders them. So […]

Modern way to defer CSS and JavaScript resources to improve page load speed Read More »

Detailed explanation of http CORS options request (preflight request)

1. Introduction to CORS for Cross-Origin Resource Sharing The entire CORS communication process is automatically completed by the browser and does not require user participation. The key to implementing CORS communication is the server. Cross-origin communication is possible as long as the server implements the CORS interface. The OPTIONS request is a preflight request ,

Detailed explanation of http CORS options request (preflight request) Read More »

Inventory those black technologies used in low-latency network architecture!

Hello everyone, I’m Fei Ge! Recently, I briefly studied the low-latency network architecture and shared it with you today. When it comes to an excellent low-latency network architecture, the first thing that comes to mind is the Internet giants, such as Tencent Alibaba Bytes. They always feel that the big companies must do the best.

Inventory those black technologies used in low-latency network architecture! Read More »

postMessage – cross domain messaging

The window.postMessage() method allows scripts from one document to pass text messages to scripts in another document, regardless of whether they are cross-domain or not. Scripts in one document still cannot call methods and read properties in other documents, but they can communicate securely using this messaging technique. This technique is called “Cross Document Messaging”,

postMessage – cross domain messaging Read More »

js generates random numbers

js generates random numbers usually using the Math.random() function of javascript Several commonly used methods: Math.random() means: the result is between 0-1 (including 0, excluding 1); Math.floor(Math.random()*10+1) indicates that the result is a random number between 1-10 Math.floor(Math.random()*24) means the result is a random number between 0-23 1.Math.random(); returns a random number between 0-1, may

js generates random numbers Read More »

Two ways to get custom attributes in js

js to get two methods of custom attributes Four ways to get properties First get an element: var elem = document.getElementById(‘elem’); 1 1. Point (can not get custom attributes): 2. [] can also get attributes, which is beneficial for parameter transfer operations. elem.style[‘background’] = ‘yellow’ 1 3. getAttribute(): The early method of obtaining custom attributes.

Two ways to get custom attributes in js Read More »

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 »

when is the funniest joke

Original link: https://onojyun.com/2022/10/29/7651/ △ 302|When is the funniest joke It is a pity that the research indicated in the title itself has no meaning to the society, but I did research and draw conclusions on this topic just now. The scene is on the way to “listening to a class”, and I suddenly thought of

when is the funniest joke Read More »