Sometimes you want to preload images that you will be using later. E.g. if hovering over a an area changes...
Spreewald gives you the within meta step that will constrain page inspection to a given scope. Unfortunately, this does not...
To delay your entire Jasmine test suite until the DOM is ready, add the following: beforeAll(function(done) { $(done); });
When you have a localized website, you may want to redirect users to their preferred language when they visit the...
fake_stripe spins up a local server that acts like Stripe’s and also serves a fake version of Stripe.js...
This gem gives you a rake task db:seed:dump do create a db/seeds.rb from your current database state.
You can use JavaScript to get or set cookie values on the client. Using the vanilla JavaScript API
Current webkit browsers like Chrome and Safari have a special variable in their consoles that refers to the selected DOM...
The NestedHash class allows you to read and write hashes of any depth. Examples: hash = {} NestedHash.write hash, 'a', 'b', 'c...
The attached Coffeescript helper will let you create mouse events: $element = $('div') Trigger.mouseover($element) Trigger.mouseenter($element) Trigger.mousedown($element) Trigger.mouseup($element...
Some modern Javascript APIs return iterators instead of arrays. In plain Javascript you can loop through an iterator using
To upload a file via AJAX (e.g. from an ) you need to wrap your params in a FormData object.
If you want to perform a failover on another haproxy backend server this is the way you should do it...
This will give the target site full access to your Javascript environment through window.opener, if the target is on the...
Let's say you want to find the element with the text hello in the following DOM tree: hello
Validations should be covered by a model's spec. This card shows how to test an individual validation. This is...
Angular's directives have a transclude option, that allows for rendering an element's original content within the directive's...
A HTTP 302 Found redirect to PATCH and DELETE requests will be followed with PATCH or DELETE. Redirect responses to...
In JavaScript we often use Immediately Invoked Function Expessions (or IIFEs) to prevent local variables from bleeding into an outside...
During debugging you might pepper your code with lines like these: console.log('foo = ' + foo + ', bar = ' + bar) I recommend to use...
There are cases when you need to select DOM elements without jQuery, such as: when jQuery is not available
Until recently, you could open a new tab via window.open when using execute_script in Selenium tests. It no longer...
Regular expressions in Javascript are represented by a RegExp object. There also is a regex literal as in many other...
MutationObserver provides developers a way to react to changes in a DOM. Any: insertion, deletion, attribute change – anything. Quickstart: https://...