Category Archives: jQuery

Debouncing Delegated Events in jQuery

12 May 2017

If you’ve read any of my posts you might have seen the pattern I like to use for using event delegation. That pattern, in its simplest form, looks like this: $(document).ready({ $('body').on('click','div',changeSomething); function changeSomething(e){ // do something } }); For me this is super useful – I can dynamically add elements to the DOM and […]

Read More

Trigger Basic Auth Dialog with jQuery / AJAX

05 May 2017

We’re all familiar with basic authentication (or should be) – my experience with it has been via cPanel or doing it by hand on *nix servers. Once setup it just works. The other day I was integrating an app into a service where the dev environment had basic authentication on it. My AJAX calls were […]

Read More

Templating with jQuery

11 Jan 2016

There are a few templating libraries available which you could use to create templates for your apps. While its easy enough to learn how to use them you could also just as easily create your own external template files for your jQuery-based projects using the jQuery skills you already have. Discussed here is a simple […]

Read More

Creating UI Using HTML5 Data Attributes

28 Mar 2015

As you may know part of the HTML5 spec includes the use of “data” attributes within HTML elements. For example: <div data-animal="frog"></div> You can see the naming convention – the first part must be “data-” and the part after can be anything. This feature provides a mechanism for storing information within your elements for whatever […]

Read More

Hashbang View Routing with History Support

25 Jul 2014

In the world of web-apps we commonly create our applications as “single-page websites”. That is, the page never reloads – we opt instead to manipulate the DOM based on user input to give the look of a seamless native application. Frequently we may need to have the ability to go “back” to the previous view […]

Read More