JavaScript Garden is a growing collection of documentation about the most quirky parts of the JavaScript programming language. It gives advice to avoid common mistakes, subtle bugs, as well as...
...performance issues and bad practices that non-expert JavaScript programmers may encounter on their endeavours into the depths of the language. JavaScript Garden does not aim to teach you JavaScript...
The Javascript code below is a rough equivalent to the simple_format helper that ships with Rails: function simpleFormat(str) { str = str.replace(/\r\n?/, "\n"); str = $.trim(str); if (str.length...
Despite the many JavaScript libraries that are available today, I cannot find one that makes it easy to add keyboard shortcuts(or accelerators) to your javascript app. This is because...
...keyboard shortcuts where only used in JavaScript games - no serious web application used keyboard shortcuts to navigate around its interface. But Google apps like Google Reader and Gmail changed that...
...to use for Selenium+Chrome). Similar sounding but completely different card: Detect if a Javascript is running under Selenium WebDriver (with Rails...
So you want to find out how many horizontal pixels you have available on a mobile device. This is super...
...triggers events that were registered through jQuery. Events registered through CSS or the native Javascript registry will not trigger...
The basic idea is pretty simple: an element's height is accessible via the offsetHeight property, its drawn height via...
TLDR: A function is hard to use when it sometimes returns a promise and sometimes throws an exception. When writing...
Chosen is a JavaScript plugin that makes long, unwieldy select boxes much more user-friendly. It is currently available in both jQuery and Prototype flavors...
Javascript that implements client-side hyphenation of HTML-Documents...
jQuery plugin to register callback functions to keyboard shortkuts. Keyboard events in vanilla Javascripts are super-painful to work with, so hopefully this library can help...
Added utility methods for the Prototype Javascript framework...
Prototip allows you to easily create both simple and complex tooltips using the Prototype javascript framework. Please note: "Permission to use Prototip on your domain is required and can be...
String manipulation extensions for the Underscore.js javascript library...
Flot is a pure Javascript plotting library for jQuery. It produces graphical plots of arbitrary datasets on-the-fly client-side...
Javascript sprite library for Canvas
The Holy Grail of testing for front-end development; execute browser-less, console-based, javascript + DOM code right from within your Rails test suite...
You can use this code: function scrollToLine($textarea, lineNumber) { var lineHeight = parseInt($textarea.css('line-height')); $textarea.scrollTop(lineNumber * lineHeight); }
When I enter "text" into the browser dialog Also see Accept or deny JavaScript confirmation dialogs in Capybara/Selenium...
Using the JS fullscreen API is painful because all browers use different methods and events and you need to use...
This is non-trivial because you need to fake event objects and require different code for different browsers. Luckily, there...
To test that an object was constructed by a given constructor function, use jasmine.any(Klass): describe('plus()', function() { it ('returns...
...DOM handling, CSS selector, JSON, Canvas, and SVG. PhantomJS can be fully scripted using JavaScript. It is an optimal solution for headless testing of web-based applications, site scraping, pages...
When cucumber encounters a failing step in a @javascript feature, the selenium browser window instantly closes. Sometimes you do not want that, because you need to see what is going...