Unobtrusive jQuery to toggle visibility with selects and checkboxes

jQuery can show or hide form sections based on select values, radio buttons, checkboxes, blank values, and _checked or _unchecked states.

Navigating through the browser history in a cucumber feature using selenium

Browser history navigation in Cucumber Selenium steps can be automated with window.history.back() through JavaScript when direct back-button control is needed.

Dealing with "TypeError: Converting circular structure to JSON" on JavaScript

Circular references make JSON.stringify fail with TypeError; a custom serializer or safe stringifier is needed to inspect or export object graphs.

Detect effective horizontal pixel width on a mobile device with Javascript

Determining usable horizontal width on mobile is unreliable because device pixels, CSS pixels, and orientation differ across platforms. effectiveDeviceWidth() normalizes screen size with window.orientation and devicePixelRatio.

JavaScript Coordinates

Positioning elements in JavaScript depends on window-relative and document-relative coordinates; mixing them causes misplaced layouts and incorrect measurements.

RaphaelJS: A Javascript vector graphics library

Small JavaScript library for drawing scalable graphics on the web; useful for custom charts and image manipulation widgets.

A tracer utility in 2kb « JavaScript, JavaScript

Inspired by a snippet of code in Oliver Steele’s legendary Functional library, here’s a lightweight tool to help keep track of JavaScript invocations. It works in Chrome, Safari, Firebug and IE8.

The Easiest Way to Parse URLs with JavaScript

Parsing URLs is simpler with an <a> element than with new URL(...), and it also handles incomplete relative paths; IE11 may omit the leading slash.

Moment.js - A lightweight javascript date library

A lightweight JavaScript date library for parsing, manipulating, and formatting dates.

How to test if an element has scrollbars with JavaScript (Cucumber step inside)

Detecting overflow in an element matters when layout must avoid hidden content and unwanted scroll bars; comparing scrollHeight and offsetHeight reveals whether content exceeds the visible area.

Cucumber step to manually trigger javascript events in Selenium scenarios (using jQuery)

Selenium can miss browser events such as change during form input; a Cucumber step can fire jQuery-registered events manually with execute_script.

Updated: Capybara: Check that a page element is hidden via CSS

Hidden-element checks in Capybara can fail in Selenium when visibility is inferred too loosely. A JavaScript-based step works across Selenium, jQuery, Prototype, and Rack::Test.

Middleman does not fingerprint asset paths by default

Middleman static sites serve stable asset URLs by default, so cached JavaScript and CSS can stay outdated. :asset_hash adds fingerprinted paths to force cache refreshes.

Chosen - makes select boxes better

Long, unwieldy dropdowns become easier to use with Chosen, a JavaScript enhancement available for jQuery and Prototype.

epeli / Underscore.strings / source — bitbucket.org

String helper extensions for Underscore.js add convenient text utilities to JavaScript projects.

Flash-Free Clipboard for the Web

JavaScript copy-to-clipboard support is moving into browsers through document.execCommand, reducing the need for Flash-based fallback buttons.

rails/turbolinks

Speeds up navigation by keeping the page alive between link clicks, avoiding repeated JavaScript and CSS recompilation while replacing the body and title.

How to find out the currently focused DOM element with JavaScript

document.activeElement returns the currently focused DOM element and is useful for checking focus state in JavaScript or Selenium tests.

Updated: Check whether an element is visible or hidden with Javascript

Determining whether an element is truly visible in the browser can differ across JavaScript libraries; jQuery and Prototype use different visibility rules.

Making Sass talk to JavaScript with JSON | CSS-Tricks

A workaround for passing data from Sass to JavaScript through JSON, later extracted into a library.

Cucumber: More patience for Selenium features

Parallel Selenium features can time out when Capybara waits too little for browser-server interactions; a support file increases patience for @javascript scenarios.

screenfull.js: Simple wrapper for cross-browser usage of the JavaScript Fullscreen API

Browser fullscreen handling is inconsistent across vendors, forcing boilerplate and event workarounds. screenfull provides a small wrapper for cross-browser fullscreen requests, exit, state, and change events.

Trigger an event with Javascript

Synthetic DOM events are awkward across browsers, especially for clicks and custom events. jQuery, Prototype, and Element.fire() offer simpler ways to simulate them.

KeyboardJS

JavaScript key binding library for handling single keys and key combinations in web apps.