blog.arkency.com

Amazing guide how to divide a ball of Javascript spaghetti distinct separate layers (model, view, controller, backend adapter). It does not use a Javascript framework...

kushagragour.in

A tooltip library that does not use Javascript. Works in IE9+. This library (or the technique used by it) could be a great choice for projects with a lot of...

...tooltips, which are hard to do fast with Javascript...

teddevito.com

This is a demo of the "Tabby" Javascript jQuery plugin to use tabs in regular textareas to make them suitable for in-browser coding of languages like HTML, CSS, Javascript...

makandra dev
github.com

Currently not possible as the linked .htc file contains JavaScript which is not explicitly called. The developers are working on a pure JavaScript solution which will have some downsides but...

github.com

...Often you’ll want to run only some scenarios with a driver that supports JavaScript, Capybara makes this easy: simply tag the scenario (or feature) with @javascript...

...openTasks = $.find('.task.open', container); Note that Sizzle returns vanilla DOM nodes in a vanilla Javascript array. It does not return jQuery collections...

...will break after modifying the collection like above. The following solution works. It uses JavaScript methods which modify the object in place, thus keeping any extra attributes: var index = element.indexOf...

angular-tips.com

Service just like Factory, but: instead of a funciton, it receives a Javascript class / a constructor function as argument simplest service type, but also least flexible Value

When you need to check a value for presence, don't rely on JavaScript since it considers 0 or "0" false. Also don't rely on LoDash's _.isEmpty:

Having a unique selector for an element is useful to later select it from JavaScript or to update a fragment with an Unpoly. Haml lets you use square brackets ([]) to...

...in your PT profile or in ~/.config/geordi/global.yml if you have ever used geordi commit javascript: (function() { var pt_project_id = 'XXX'; var pt_token='XXX'; var url = `https://www.pivotaltracker.com/services/v5/projects/$...

...mind that the above examples use jQuery. Tweak accordingly if you are using another JavaScript framework...

...someone reloads a form by pressing enter/return in the URL field, or by opening JavaScript links incorrectly. The attached initializer provides a default way to deal with this.

...Another concise way to write the statement is this: console.log({ foo, bar }); This uses Javascript's new destructuring syntax and is actually shorthand for: console.log({ foo: foo, bar: bar });

...this, you simply cannot clone instances of Coffeescript instances as you would clone other Javascript hashes. If you need cloning, you would probably need to implement a clone() method in...

behavior: url(/PIE.htc); background: white; } li.active .content { background: red; } If you now use JavaScript to add the class .active to another li, the contained .content (whose background should have...

...a nice data attribute to the form fields, and look for that in your JavaScript code: document.on('change', '[data-requires-update]', updateThings); If you are interested in the element that...

makandra dev
css-tricks.com

...re already using lazysizes, you can use its object-fit polyfill! Usage In your Javascript manifest, require them like this: #= require plugins/object-fit/ls.object-fit #= require lazysizes Now use the mixin below to...

...a correct window. [1] as in: a real browser window, maybe via window.open in JavaScript

...this useful when creating responsive designs that work well on small screens. The attached Javascript gives a container different CSS classes (single_line or multiple_lines) depending on whether its...

...not necessarily a link or button, but could be any HTML element with a Javascript event binding. The easiest way to get this step is to use Spreewald. If you...

makandra dev
github.com

...flaky end-to-end tests: This Ruby gem synchronizes Capybara commands with client-side JavaScript and AJAX requests. This greatly improves the stability of a full-stack integration test suite...

...aka least harmful) submit element before others. NB: If you submit a form via JavaScript none of the buttons' attributes will be submitted...

developers.google.com

...so you can both use up the entire quota. Note that the Google Maps Javascript API (the one that draws maps on the screen) has a different quota policy. Here...