Progressive Enhancement is Still Important

Jake Archibald makes a compelling case that progressive enhancement is still important, not because of users who’ve chosen to disable JavaScript, or because of outdated accessibility concerns, but because of graceful error handling and faster page rendering. He also dispels some myths, pointing out that building a progressively-enhanced application doesn’t have to require duplicating server-side logic and templating on the […]

Continue reading...

Attaching Uploads to Custom Post Types

I’m working on a plugin that implements a custom post type, and it doesn’t need the editor, but I do want to upload files. I setup the everything like you normally would, but I noticed that the files weren’t being attached to the post when they were uploaded. I couldn’t find anything online, so I dug through […]

Continue reading...

Progressive Enhancement with Backbone.js

I’m mostly focusing on back-end development these days, so I’m a bit behind the curve on a lot of the recent front-end practices, but I’ve been playing around with Backbone.js a bit, and one of the things that’s been nagging me is the hard dependency on JavaScript for the core functionality of the site. Looking around for some […]

Continue reading...

Reusing P2’s ajaxUrl Short-Circuits Other AJAX Requests

I just spent awhile tracking down some odd AJAX behavior that was puzzling me, so I thought I’d share the solution. I was working on a plugin to extend P2 and my AJAX requests were always responding with -1. After a lot of digging and some trial-and-error, I figured out that it was happening because I was […]

Continue reading...

Dynamically Adding HTML Elements to a Masonry Container

The official Masonry documentation doesn’t really cover this well, and all the external examples I found seem to be outdated. I got it working in v3.1.2 via trial and error. Basically, you just have to reload all the items before laying them out. Makes sense once you understand it… var mediaItemContainer = $( '#container' ); mediaItemContainer.masonry( […]

Continue reading...

Registering jQuery Event Handlers Before the Elements Exist

Update: I removed the link to the article because the site now contains malware. Dave Ward wrote an article Don’t let jQuery’s $(document).ready() slow you down that shows a few situations where execute the contents of a JavaScript file immediately, rather than wrapping it all inside jQuery( document ).ready(). The .live() method has been deprecated since he wrote the […]

Continue reading...