John Cox

Blogs · @wyome · Now · Shelf

Interesting

7 JavaScript Basics Many Developers Aren't Using (Properly) - Tech.Pro

The saved text contains no article, only the navigation and header of a UK mobile phone parts retailer's website. It lists product categories (iPhone, iPad, Samsung, Huawei and Sony LCD screens, batteries, digitizers, cases, chargers, repair tools), a phone number, and login and cart links. The only substantive content is the shipping promotion: free next-working-day delivery on orders placed before 1pm, and free shipping on orders over £100. The page capture seems to have missed the body, so to recover whatever you meant to keep, such as a repair guide from the site's blog, you'll need to go back to the original URL.

Permalink

jQuery RegEx Examples to use with .match() | jQuery4u

A cheat sheet of copy-paste JavaScript regular expressions, grouped by task: numbers (integers, floats, IP addresses, ranges like 0-255 or 1-50), form validation (email, credit cards, usernames, strong passwords, phone numbers), dates, URLs and slugs, whitespace and newline handling, domain names, image and script/link tag matching, plus color codes and HTML tags. It's framed as jQuery but the patterns are plain JS regex, and the author warns that many are not thoroughly tested, which matters since several are written as quoted strings (with unescaped backslashes) rather than regex literals and so won't work as pasted.

Permalink

Table-to-JSON

This is a demo page for a jQuery plugin, tableToJSON, that converts an HTML table into a JavaScript object via `$('#example-table').tableToJSON()`. This example shows the `data-override` attribute: putting it on a header cell renames that column's key (here "Points" becomes "Score"), and putting it on a body cell replaces that cell's value in the output (Jill Smith's 50 becomes "disqualified"). The sample is a four-row table of names and points, with a click handler that logs the result and alerts it as a JSON string.

Permalink

Bootstrap

This is the Bootstrap 5.3.8 landing and getting-started page. It lays out three ways to install the framework (npm or gem, the jsDelivr CDN with integrity hashes, or source download) and then walks through the main customization routes. These are Sass variable overrides with selective imports, CSS variables scoped at `:root` and on individual components, and the Sass-map Utility API for adding or changing utility classes. It also pitches the jQuery-free, data-attribute-driven JavaScript plugins and the separate Bootstrap Icons SVG library, with code snippets for each, so it's useful mainly as a quick reference for setup and the import order that Sass customization requires.

Permalink

HTML5 Datalist: What You Need To Know - noupe

A walkthrough of the HTML5 `<datalist>` element, which adds native autocomplete suggestions to inputs by linking an `<input list="...">` to a datalist of `<option>`s, with no JavaScript. It covers how it differs from the `autocomplete` attribute, its use on range sliders, and when it fits (free-text fields, or very long lists like countries) versus when a `<select>` is better. It also gives code for enforcing a valid choice via the constraint validation API, fallbacks for unsupported browsers (a nested `<select>`, or a Modernizr-plus-jQuery UI autocomplete polyfill with old-IE workarounds), and the limits of datalists on styling, matching rules, and server-side data.

Permalink

Eminent domain and the decline of Detroit

Ilya Somin argues that Detroit's long decline and eventual bankruptcy owe something to the city's habit of using eminent domain to hand property to politically connected private interests in the name of "economic development" and "urban renewal." His central example is the 1981 Poletown case, where about 4,000 people lost their homes and many businesses were displaced for a General Motors factory, a project he contends destroyed far more development than it produced. He also points to Justice James Ryan's dissent, which predicted the promised growth wouldn't materialize and accused the court of subordinating a constitutional right to corporate interests.

Permalink

TouchSwipe: a jQuery plugin for touch and gesture-based interaction

TouchSwipe is a jQuery plugin, written in 2010 for an iPad-only Renault site with a swipeable car gallery, that adds touch gesture detection to an element because jQuery Mobile was still immature. The page walks through its API with code samples: a general swipe handler and per-direction ones (swipeLeft, swipeRight and so on) that report direction, distance, duration and finger count, plus options for a minimum distance threshold (default 75px) and restricting by number of fingers. It also covers swipeStatus, which fires through the start, move, end and cancel phases and supports drag-style interactions like an image scroller that snaps back if the swipe is incomplete, with links to the demos, docs and GitHub repo.

Permalink

Pure

Pure.css is a lightweight CSS framework, about 3.5KB minified and gzipped, made up of small modules (grids, menus, forms, buttons and the like) that build on Normalize.css and are responsive out of the box. Its pitch is that it is deliberately minimal, flat and unopinionated: it styles native HTML elements and common UI components, then stays out of the way so you add your own rules rather than fight existing ones. You can load it from a CDN with a single link tag or use only a subset of modules to save more bytes, and the page points to sample layouts as starting points for new projects.

Permalink

date

Date.js is a small JavaScript library that turns natural-language phrases like "tomorrow night at 5", "next week wednesday", "in 3 hours" or "last month" into Date objects. The core call is date(str, [offset]), where the optional offset replaces the current moment as the starting point for relative expressions. It installs through npm or as a standalone browser script (date.js or date.min.js), has a make-based test suite run under node.js, and is MIT licensed.

Permalink

PhantomJS: Headless WebKit with JavaScript API

This is the PhantomJS homepage, introducing a headless web browser that you script with JavaScript and that runs on Windows, macOS, Linux, and FreeBSD. It is built on QtWebKit and supports DOM handling, CSS selectors, JSON, Canvas, and SVG. A banner notes that development is suspended until further notice, so the project is effectively on hold. The page shows a short example script that loads the Google homepage and saves a screenshot, then lists four main uses: page automation, screen capture, headless testing with frameworks like Jasmine, QUnit, and Mocha, and network monitoring with HAR export. It also links to the Quick Start guide, FAQ, API docs, and the GitHub repo.

Permalink

Furatto

Furatto's landing page pitches it as a mobile-first front-end framework for fast development, built on Sass and Compass, with a simple grid and an emphasis on being extendable and highly customizable. It offers four starter templates (a bare-bones page, a login form, a gallery, and a blog) as quick launch points for new projects. It also invites contributions through opening issues, tweeting about it, or submitting themes. The page is only a promotional overview and gives no technical detail, so it's useful mainly as a pointer to a Bootstrap-style alternative.

Permalink

Should I Use A Carousel?

A tongue-in-cheek single-page argument against homepage carousels, built as a slideshow of evidence and expert quotes. It leads with Notre Dame's click data (only 1% of visitors clicked a feature, and 89% of those clicks hit the first slide) and then cites Nielsen Norman Group, Wider Funnel, and others whose testing found users miss or ignore rotating content. It closes with Jared Smith's point that carousels create accessibility problems for keyboard and screen reader users that markup can't fix, and Lee Duddell's cynical note that they mainly serve to appease internal stakeholders.

Permalink