Skip to content

WebCheatSheet

The easy way to know

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

Category: JavaScript

JavaScript

Get the N Largest Numbers from a JavaScript Array

Sergey KornilovDecember 2, 2026

Sort a copy numerically and take the first N values without changing the original array.

JavaScript

Poll for New Messages Without Overlapping Browser Requests

Sergey KornilovNovember 28, 2026

Schedule the next message poll after the current request finishes, pause requests in hidden tabs, and slow down when the endpoint is idle.

JavaScript

Keep JavaScript Module Scope Separate from iframe Documents

Sergey KornilovNovember 24, 2026

Load module scripts independently in a parent page and an iframe, because each frame is a separate document with its own scope.

JavaScript

Understand Promise.resolve() with Function Values

Sergey KornilovNovember 15, 2026

Learn why Promise.resolve receives a function as a value without calling it, and how Promise.try captures synchronous exceptions.

JavaScript

Validate API JSON before Reading Array Length

Sergey KornilovNovember 13, 2026

Check the HTTP response and JSON shape before reading length, then render an empty array separately from a malformed API response.

JavaScript

Return Data from a Popup Window with postMessage

Sergey KornilovNovember 12, 2026

Send a small result from a popup to its opener with postMessage, while checking the exact origin, window source, and message shape.

JavaScript

Configure Credentialed CORS without Wildcard Origins

Sergey KornilovNovember 11, 2026

Allow cookies on cross-origin requests only for trusted origins, return an explicit origin, and keep shared caches correct with Vary: Origin.

JavaScript

Convert HTML Table Rows to JavaScript Objects

Sergey KornilovNovember 4, 2026

Give editable controls stable name attributes, map each table row, and create one object per row with Object.fromEntries().

JavaScript

Handle Delegated Button Clicks When the Icon Is Clicked

Sergey KornilovNovember 1, 2026

Use event.target.closest() to find the intended button when a delegated click begins on an icon or another child element.

JavaScript

Share a Fetch Request Without Sharing Cancellation

Sergey KornilovOctober 30, 2026

Deduplicate an in-flight fetch while giving each caller its own AbortSignal and aborting the network request only after every waiter leaves.

Posts navigation

Older 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.