Skip to content

WebCheatSheet

The easy way to know

  • PHP
  • HTML
  • JavaScript
  • SQL
  • ASP
  • MS Access Functions
  • SaaS
  • Email

Category: JavaScript

JavaScript

Use a Barcode Scanner with a Web App as Keyboard Input

Sergey KornilovOctober 24, 2026

Capture USB or Bluetooth barcode scans in a web form, submit them with Fetch, and prevent duplicate attendance records on the server.

JavaScript

Parse Multiline Language Blocks with JavaScript

Sergey KornilovOctober 19, 2026

Use matchAll, named capture groups, and a newline-safe pattern to extract text blocks followed by two-letter language markers.

JavaScript

Read Browser WebSocket Messages Correctly in Java

Sergey KornilovOctober 18, 2026

Use a WebSocket server implementation instead of reading browser traffic as raw TCP bytes, and receive text frames as decoded strings.

JavaScript

Fix “createPopper Is Not a Function” in Bootstrap

Sergey KornilovOctober 18, 2026

Load one compatible Bootstrap bundle, remove duplicate or mismatched scripts, and initialize dropdowns only after the bundle is available.

JavaScript

Store Custom Data on DOM Elements Safely

Sergey KornilovOctober 17, 2026

Use data attributes for short public strings and a WeakMap for private objects, callbacks, and component state without modifying DOM objects.

JavaScript

Toggle a Menu Reliably with JavaScript classList

Sergey KornilovOctober 15, 2026

Keep menu state in a CSS class, update aria-expanded from the resulting state, and avoid one-time inline-style comparisons.

JavaScript

Fix GA4 When gtag.js Loads but Sends No Hits

Sergey KornilovOctober 15, 2026

Restore the standard gtag wrapper, verify command order and the measurement ID, then confirm a collection request and DebugView event.

JavaScript

Build a Custom Context Menu in JavaScript

Sergey KornilovOctober 15, 2026

Handle the contextmenu event, position an HTML menu inside the viewport, and provide an equivalent keyboard-accessible control.

JavaScript

Update CSS Attribute Selectors from JavaScript

Sergey KornilovOctober 14, 2026

Set a real data attribute on the element and match its exact serialized value with a CSS attribute selector.

JavaScript

Detect New Gamepad Button Presses in JavaScript

Sergey KornilovOctober 14, 2026

Poll the Gamepad API once per frame and compare the current button state with the previous snapshot to detect new presses.

Posts navigation

Older posts
Newer posts

Recent Posts

  • Require Exactly One Result from a PHP Iterator
  • Choose Valid Options for PHP Dom HTMLDocument
  • Validate UTF-8 Byte Limits Before Storing Text
  • Compare Each Row with Its Group Average in MySQL
  • Find XML Elements by a Custom ID Attribute in PHP

Recent Comments

  1. Require Exactly One Result from a PHP Iterator - WebCheatSheet on PHP Arrays: Indexed, Associative, and Multidimensional
  2. Find XML Elements by a Custom ID Attribute in PHP - WebCheatSheet on Export a MySQL Database Schema as XML with PHP
  3. Compare Each Row with Its Group Average in MySQL - WebCheatSheet on SQL GROUP BY
  4. Get the N Largest Numbers from a JavaScript Array - WebCheatSheet on JavaScript Arrays
  5. Compare the Return Value of PHP include Correctly - WebCheatSheet on PHP Functions: Parameters, Return Types, and Scope

Archives

  • December 2026
  • November 2026
  • October 2026
  • September 2026
  • August 2026
  • October 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022

Categories

  • ASP
  • Email
  • HTML
  • JavaScript
  • MS Access Functions
  • PHP
  • SaaS Architecture
  • SQL
  • Uncategorized
Copyright © 2026 WebCheatSheetFresh News by Ascendoor | Powered by WordPress.