John Cox

Blogs · @wyome

Tagged development · everything

jQuery 3.0: The Next Generations | Official jQuery Blog

jQuery is transitioning to semantic versioning with version 3.0 by splitting into two packages: jQuery 3.0 for modern evergreen browsers and jQuery Compat 3.0 for broad browser support including older versions like IE8. Despite the major version jump, the change is primarily nomenclature-driven to follow semver standards, with both packages maintaining the same public API and available through npm, Bower, and major CDNs. A new jQuery Migrate plugin will help identify deprecated methods that users need to update.

Permalink

Get Real Image Height and Width Dimensions

The piece explains how to retrieve an image's original dimensions in JavaScript using the `naturalWidth` and `naturalHeight` properties, which return the actual image file size regardless of CSS styling that may have resized it. The author discovered these read-only properties while seeking a way to access an image's "true" size independent of any CSS modifications like `max-width: 100%`. The properties only become reliable after the image has fully loaded, so checking them within a load event listener is necessary.

Permalink

JavaScript for OS X Automation by Example -Telerik Developer Network

Apple's OS X Yosemite operating system includes JavaScript as an automation tool for OS X, a feature that received little attention from tech journalists but proved significant enough for developer tools company Telerik to highlight through practical examples. The post demonstrates how developers can leverage JavaScript for system-level automation tasks on Mac computers, expanding the scripting capabilities beyond traditional AppleScript approaches.

Permalink

Building OS X Apps with JavaScript by Tyler Gaw

OS X Yosemite's JavaScript for Automation feature allows developers to write native Mac applications using JavaScript instead of AppleScript, with full access to Objective-C frameworks through a bridge that lets you import and use classes like Cocoa for building GUIs. The post provides a detailed walkthrough of building a complete example app that lets users select and display images, explaining the syntax conversions needed to use Objective-C methods in JavaScript, how to create UI elements, handle button clicks through subclassing, and work with file dialogs. The author argues this is significant because it removes barriers to Mac app development by letting anyone with JavaScript knowledge build native applications without additional tools or installations.

Permalink

highlight.js

Highlight.js is a syntax highlighting library that can be integrated into projects through multiple methods including CDN, Node.js modules, or Vue plugins, with support for 193 languages. When using it as an ES6 module, you can import all languages by default or selectively load only the languages you need to minimize bundle size. The library provides `highlight()` and `highlightAuto()` functions to colorize code, and when used in HTML, it automatically detects and highlights code within `<pre><code>` tags.

Permalink

Swift Access Control - Private, Internal and Public [iOS developer:tips];

I can't write a meaningful summary of this piece because it appears to be a landing page or placeholder for a non-profit organization still under development, rather than an article or report that makes specific arguments or conveys concrete information. The page describes general intentions (volunteer distribution, skill-building, safe spaces) without detailing any actual community impact initiative, outcomes, or reporting.

Permalink

AjaxQ jQuery Plugin

AjaxQ is a lightweight jQuery plugin that manages sequential AJAX requests by organizing them into named queues, where requests in the same queue execute one after another while different queues can run in parallel. The plugin provides a simple API that mirrors jQuery's $.ajax, $.get, and $.post methods with queue management utilities like checking queue status, aborting requests, and clearing pending items. At only 600 bytes minified and gzipped, it offers a minimal way to control request ordering without complex external dependencies.

Permalink

A JavaScript Constructor Problem, and Three Solutions

JavaScript constructor functions accidentally called without the `new` keyword can silently fail or corrupt the global scope, but three patterns can prevent this: auto-instantiation checks if `this instanceof Constructor` and recursively calls itself with `new` if needed, enabling decorators to wrap constructors; overloading lets the constructor function do double duty as both an instantiator and an `instanceof` test; or explicitly throwing an error when `new` is omitted, combined with a static `is()` method for type checking.

Permalink

Promises in PHP

The author implemented Promise support in the sabre/event 2.0 library after finding a practical use case: building a client for a web service requiring numerous HTTP requests that needed to execute both sequentially and in parallel. Though Promises are uncommon in PHP since the language lacks the asynchronous architecture and event loops typical of JavaScript, the author distilled the pattern into a single relatively simple class that proved ideal for managing complex request ordering and concurrent operations.

Permalink

jQuery Before/After Plugin | Catch My Fame

IVR (Interactive Voice Response) systems use pre-recorded voice prompts and keypad inputs to handle high volumes of incoming calls, and have been adapted for dating and social connection services like Friend-O-Phone and ChatlineDating. The piece also discusses common IVR design failures—such as overly complex menu trees, counterintuitive routing options, and lack of callback features—that frustrate callers and diminish service quality.

Permalink

QUnit

QUnit is a JavaScript testing framework that requires minimal setup and runs across multiple environments including browsers, Node.js, and Web Workers, making it possible to test code in its actual runtime context. The framework provides straightforward APIs for writing assertions and tests, along with extensible options for custom runners and reporters to adapt to different project needs. Version 2.26.0 is available through direct download, npm, or Yarn, with documentation and community support accessible through their official channels.

Permalink

An Introduction To Node.js And MongoDB | Smashing Magazine

This tutorial walks through building a basic Node.js server that queries a MongoDB database and serves the results as an HTML page. It covers installing Node.js, MongoDB, and the MongoJS library, then demonstrates how to connect to a MongoDB instance, execute a database query to retrieve filtered records, iterate through the results, and render them as HTML to send to the browser. The example queries a collection for vehicles with a red finish and displays their properties on a localhost server running on port 8888.

Permalink

12 Little-Known CSS Facts

A collection of lesser-known CSS properties and behaviors that even experienced developers might overlook, including how the color property affects not just text but also alt text, list markers, and borders; the rarely-used visibility collapse value for tables; the expanded background shorthand now including background-size, background-origin, and background-clip; and quirks like vertical percentage values being calculated against container width rather than height, the clip property only working on absolutely positioned elements, and text-decoration becoming a shorthand property for line, color, and style. The post also covers niche features like border-image, empty-cells for tables, and the oblique font-style value, most of which have limited practical application but are worth knowing about for edge cases.

Permalink