Recent Code News

|

I’ve been playing Battlefield 3 recently, but the new Battlelog service has a few issues surrounding refreshing and joining servers that are driving me crazy.

I’ve attempted to address these issues with a new userscript called Battlelog Hacks, so check it out and let me know what you think!


|

Earlier this month, I spoke at the Boston jQuery Conference, where my talk on “Plugin Authoring Best Practices” was well received. It went so well that I’m going to be giving it talk again, but this time online, at the jQuery Summit!

Like last year, I’ll be giving two talks. On the first day, I’ll be giving the aforementioned Plugin talk. On the second day, I’ll be giving a talk on JavaScript Unit Testing with QUnit.

Continue on for more information about my talks and a 20% off coupon code!


|

I’m very excited to be speaking at this year’s Boston jQuery Conference. I’ll be giving a talk entitled “Plugin Authoring Best Practices,” so be sure to sign up for the conference, come to my talk, and say hello!

Also, the day before the conference, I’m going to be giving our full-day Bocoup Beginner jQuery Training. If you’re new to jQuery, this training will help get you prepared for all the great talks that you’ll see over the weekend. The training is a good value, with all proceeds benefit the jQuery project.


|

I recently attended the jQuery Bay Area Conference, which was held at the Microsoft Silicon Valley Campus Conference Center in Mountain View, California. I decided to go not only from a personal “want to hang out with cool people” perspective, because I know many people who are active in the jQuery community, but also from a “Director of Training at Bocoup” perspective. The former is cool because it’s always nice to interact directly (ie. drink beers) with people with whom your only typical interaction is IM or IRC. The latter is cool because on the day before the conference, Bocoup donated a full day of Beginner jQuery training to a very appreciative group of attendees, with all proceeds going directly to the jQuery Project.


|

Just over a year ago, I blogged that jQuery BBQ was going into version 7 of the popular open source Drupal CMS, as a crucial part of the overlay module.

The overlay module allows the Drupal admin interface to appear seamlessly, as a modal window, on top of the current page, while maintaining that page’s context. This was, of course, a great idea, and one that jQuery BBQ made easy, with its built-in cross browser HTML5 onhashchange event and fragment management functions.

And now that Drupal 7 has finally launched, jQuery BBQ provides back button support in over 20,340 sites, not to mention the sites where it was already being used, of course.

Pretty sweet, huh?


|

In some of my recent work on a much-needed update to JavaScript Debug, I noticed a few “interesting quirks” with try…catch in Internet Explorer 6-8, so I decided to write an article with my observations.

As a change of pace, I decided to post this article to the Bocoup weblog. It’s actually my first article over there, so you should give it a read, and let me know what you think!

Read more about The “catch” with try…catch

In related news, progress on JavaScript Debug has been moving steadily forward, and I hope to have a new version out within a few weeks (which probably means a few months, given my current workload). Either way, stay tuned, because good things are in the works!


|

In case you hadn’t noticed, I’m a bit of a stickler for terminology. So, after hearing the popular, yet misleading, JavaScript term “self-executing anonymous function” (or self-invoked anonymous function) one too many times, I’ve finally decided to organize my thoughts into an article.

In addition to providing some very thorough information about how this pattern actually works, I’ve actually made a recommendation on what we should call it, moving forward. Also, If you want to skip ahead, you can just check out some actual Immediately-Invoked Function Expressions, but I recommend reading the entire article.


|

In case you missed my previous blog post, I’m speaking at the upcoming jQuery Summit, a two-day online conference taking place on November 16th and 17th. I’ll be giving two talks, “Idiomatic jQuery” and “jQuery Pluginization” (one each day). In addition to my presentations, there will also be talks by a number of other well-known jQuery community members.

In addition, I promised that a few lucky winners would win a ticket for either the Designer or Developer tracks. So, with a little help from Brendan Eich, Ronald Fisher and Frank Yates, and without further ado…


|

I’m speaking at this year’s jQuery Summit, a two-day online conference taking place on November 16th and 17th. In addition to my two talks, “Idiomatic jQuery” and “jQuery Pluginization,” there will also be talks by a number of other well-known jQuery community members as well as John Resig, creator of jQuery.

The first day, November 16th, consists of a more designer-oriented track, while the second day, November 17th, consists of a more developer-oriented track. While you’ll learn lots by attending both days, if you can only attend one of the two days, fear not: I’m presenting in both tracks!

And here’s an added bonus: I have a few tickets to give away for each day! First, follow me, @cowboy, on Twitter if you aren’t already following me. Then, send me a tweet telling me which track you’d prefer (Designer on 11/16 or Developer on 11/17), and finally, tell me why I should give you one of these tickets! I’ll notify the lucky winners on Wednesday.

If you haven’t already, sign up now, and I’ll see you online!


|

I’ve been learning more about functional programming lately, and after seeing a few interesting things on the interwebs, I decided to spend a little more time experimenting with partial application in JavaScript.

Now, I’m far from an expert in functional programming. What I’ve done here seems strange and exciting to me, and I have absolutely no idea how I would use it, or even what it’s called.

Is this partial application? Currying? Something else? (Vindaloo maybe?)

[Edit: I now know what this is called, thanks to some very helpful comments. It was explained to me that I had reversed the concepts of “partial” and “curry,” so I’ve updated my explanations and examples to be more accurate.]


|

Recently, word came through the twitter-nets that JS1k, a 1 kilobyte JavaScript competition, was accepting entries. Now, I haven’t done anything “fancy” in a while, but I used to do that kind of stuff all the time (you know, before I was married).

So I asked myself, “Ben, can you do something extra fancy in exactly 1024 bytes of JavaScript?”


|

While I generally try to avoid Firefox these days (using Chrome instead), I still like to test my code in multiple versions of all the major browsers to ensure that behavior is generally consistent. For a while, I was using MultiFirefox, which is a great utility, but I found using it to be far less streamlined than I would like.

Fortunately, I stumbled upon an article this weekend that explained how to launch Firefox with an arbitrary profile via command-line parameter (which is probably what MultiFirefox does internally). Unfortunately, because OS X aliases don’t work like Windows shortcuts, it’s a bit cumbersome to have to open the Terminal and type a command every time you want to launch Firefox… so I wrote a relatively simple AppleScript that greatly streamlines the process.

Basically, once configured, you never again have to choose which profile goes with which version of Firefox. Just run the launcher and it handles everything! If you’re curious, check out the instructions for Multi-Firefox Launcher now, and let me know what you think.


|

Next Wednesday, June 2, I’ll be talking jQuery plugin development at Boston jQuery Meetup #4, in the awesome Bocoup Loft event space.

I’m going to talk about code organization and best practices as it relates to creating modular, reusable code, aka “plugins.” I’ll focus on code maintainability, organization and generalization, and touch on performance and size optimization, in the context of jQuery plugin development. And as if that weren’t enough, I’ll even step through the creation of a jQuery plugin, taking it from concept to completion, before your very eyes.

So, if you use jQuery, or even just JavaScript, and want some free pizza and beer, along with ninety minutes of examples, explanations and Q&A, sign up now, and I’ll see you next week!


|

Even though I initially released jQuery BBQ in late 2009, the plugin has actually been many years in the making. While it started out as a little snippet of code that almost every web developer, at one point or another, has written, over time it evolved into something much larger.. and much tastier.

In this article, I’ll not only explain how jQuery BBQ came to be, but I’ll also give you some things to think about, in case you’re considering writing a jQuery plugin.


|

The jQuery special events API is a fairly flexible system by which you can specify bind and unbind hooks as well as default actions for custom events. In using this API, you can create custom events that do more than just execute bound event handlers when triggered—these “special” events can modify the event object passed to event handlers, trigger other entirely different events, or execute complex setup and teardown code when event handlers are bound to or unbound from elements.

More Recent Code News