Checking if a JavaScript value is of a given type can be very confusing: There are two operators typeof and...

Slides for Henning's talk on Sep 21st 2017. Understanding sync vs. async control flow Talking to synchronous (or "blocking...

You should prefer native promises to jQuery's Deferreds. Native promises are much faster than their jQuery equivalent. Native promises...

select2 is a great jQuery library to make (large) fields more usable. For Bootstrap 3 there is select2-bootstrap-theme...

There seems to be a nasty bug in Chrome 56 when testing with Selenium and Capybara: Slashes are not written...

TLDR: A function is hard to use when it sometimes returns a promise and sometimes throws an exception. When writing...

Chrome gives you the currently selected element in the inspector with $0. If you select a button in the DOM...

There is no CSS selector for matching elements that contains a given string ¹. Luckily, Capybara offers the :text option to...

There is no build in functionally in jQuery and Prototype to extract params from a url. You can use this...

makandra dev

Promises are the new way™ to express "Do this, and once you're done, do that". In contrast to callbacks...

stackoverflow.com

When you are working with jQuery selectors and collections, many times you want to know if the collection actually contains...

to create a Gallery that has a name and has_many :images, which in turn have a...

jQuery's find looks in the element's descendants. It will never return the current element itself, even if the...

jquery.com

Since jQuery 3 saw it's first release candidate today, the links has a list of (breaking) changes.

developer.mozilla.org

When building a form with a file select field, you may want to offer your users a live preview before...

jQuery's deferred objects behave somewhat like standard promises, but not really. One of many subtle differences is that there...

Current webkit browsers like Chrome and Safari have a special variable in their consoles that refers to the selected DOM...

The attached Coffeescript helper will let you create mouse events: $element = $('div') Trigger.mouseover($element) Trigger.mouseenter($element) Trigger.mousedown($element) Trigger.mouseup($element...

To upload a file via AJAX (e.g. from an ) you need to wrap your params in a FormData object.

Let's say you want to find the element with the text hello in the following DOM tree: hello

stackoverflow.com

From Rails 3.0.9, there is a method Hash#to_query that will turn a Hash into a query string:

There are cases when you need to select DOM elements without jQuery, such as: when jQuery is not available

CSS4 comes with :has. E.g. h1:has(b) would select all tags that contain a tag. This is implemented in...

With "attaching an event handler once" you possibly mean one of these two things: Register a function for an event...