Five methods for JavaScript to detect mobile browsers

Five methods for JavaScript to detect mobile browsers Original author: Ruan Yifeng Date: September 29, 2021 Sometimes, the front-end webpage needs to know whether the user is using a mobile browser or a desktop browser. Based on StackOverflow , this article sorts out five methods for JavaScript to detect mobile browsers. One, navigator.userAgent The easiest… Continue reading Five methods for JavaScript to detect mobile browsers

Clipboard operation Clipboard API tutorial

Clipboard operation Clipboard API tutorial Original author: Ruan Yifeng Date: January 20, 2021 1. Introduction The browser allows JavaScript scripts to read and write the clipboard, and automatically copy or paste content. In general, scripts should not modify the user’s clipboard, so as not to meet the user’s expectations. However, sometimes it can be convenient… Continue reading Clipboard operation Clipboard API tutorial

Fetch API tutorial

Fetch API tutorial Original author: Ruan Yifeng Date: December 28, 2020 fetch() It is an upgraded version of XMLHttpRequest, used to make HTTP requests in JavaScript scripts. The browser provides this object natively. This article introduces its usage in detail. 1. Basic usage fetch() The function is basically the same as XMLHttpRequest, but there are… Continue reading Fetch API tutorial