Lenix

Can’t translate? The editor teaches you how to fix Google Translate step by step

Google Translate suddenly announced its withdrawal from China, which has brought inconvenience to many users who are accustomed to using the right-click menu in the browser and then selecting “Translate to Chinese” for webpage translation operations, because now it is impossible to directly obtain translation results. It can only be an error message. How to …

Can’t translate? The editor teaches you how to fix Google Translate step by step Read More »

PHP 8.2 released!

PHP 8.2 released! PHP 8.2 brings type system improvements for performance and fine-grained type safety, readonly classes, sensitive parameter editing support, a new random extension, and many new features, as well as several changes aimed at simplifying and modernizing the PHP language, such as: Readonly classes Disjunctive Normal Form (DNF) types New independent types: null, …

PHP 8.2 released! Read More »

Axios Promise-based HTTP client

Axios , Promise-based HTTP client, can work in the browser and can also be used in node.js. Function: Create XMLHttpRequest from browser Create http requests from node.js Support Promise API Intercept requests and responses Transform request and response data cancel request Automatically convert JSON data Client support to prevent XSRF attacks Sample code: Execute a …

Axios Promise-based HTTP client Read More »

A few recommended practices for writing good JavaScript asynchronous code

Today, I will recommend a few recommended practices for writing JavaScript asynchronous code. Each scenario has a corresponding eslint rule, and you can choose to configure it. no-async-promise-executor Passing an async function to the constructor of new Promise is not recommended. // ❌ new Promise(async (resolve, reject) => {}); // ✅ new Promise((resolve, reject) => …

A few recommended practices for writing good JavaScript asynchronous code Read More »

Lazy loading of non-critical CSS

CSS files are render-blocking resources : they must be loaded and processed before the browser can render the page. Web pages that contain unnecessarily large styles take longer to render. In this guide, you’ll learn how to lazy load non-critical CSS with the goal of optimizing the critical rendering path and improving First Contentful Paint …

Lazy loading of non-critical CSS Read More »

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 »