jQuery

Build your JavaScript With jQuery 1.5.2 in Drupal 7

Posted: April 5, 2011 In / 2 Comments

Shortly after Drupal 7 launched the version of jQuery shipped with Drupal became outdated. Drupal 7 ships with jQuery 1.4.4 but the jQuery community has shipped jQuery 1.5.2. When we are developing the JavaScript in our shinny new Drupal 7 we are already using an outdated version of jQuery. But, there is a solution. The jQuery Update module provides an update for core to jQuery 1.5.2 and jQuery UI 1.8.11. Read more »

Making Drupal's JavaScript Rock Hard Awesome

Posted: February 17, 2011 In / 26 Comments

The JavaScript shipped with Drupal core is not all that great. If I'm going to be completely honest I have to say that at times I feel the code reminds me of something a JavaScript guru said to me when he said, "Some of the worst JavaScript I've seen is in Drupal core." Ouch. While I don't think this is completely true, there is some massive room for improvement.

The improvements needed to Drupal's JavaScript are no surprising to those familiar with it. For months there have been back channel conversations trying to figure out a plan of attack for Drupal 8. Once we have a plan of attack it becomes much easier to rally the troops, make design decisions, and collectively make Drupal 8 a release that shines for JavaScript. With that in mind here are four points that I think are essential to making JavaScript great in Drupal 8. Read more »

3 Tips To Make Your jQuery Selectors Faster

Posted: December 15, 2010 In / 13 Comments

In Drupal we leverage jQuery on a regular basis. Wouldn't it be great if we could make our jQuery selectors optimized and fast? The faster our JavaScript executes the faster our pages render. This is especially true due to older browsers with slower JavaScript engines and because one of the slowest types of operations even fast JavaScript engines deal with is DOM operations. Without further adieu, here are three tips for optimizing jQuery selector usage. Read more »

jQuery Date and Time Pickers

Posted: April 12, 2010 In / 1 Comment

Recently, I was looking into date and time pickers for jQuery. jQuery UI has a great datepicker but I wanted something that provided a slick time input as well. When I did some searching I found quite a few options but two seemed to stick out above the rest. Read more »

Farbtastic 1.3u

Posted: February 26, 2010 In

Farbtastic 1.2 was released years ago. In that time jQuery has changed creating a need for farbtastic to change as well. For example, internal logic in farbtastic was calculating the offset but changes in jQuery caused it to not calculate it accurately in all cases. Switching to the jQuery.offset method, which was added after the release of farbtastic 1.2, fixed the problem.

So, when I recently moved Farbtastic over to GitHub to continue development I created a tag called 1.3u (the u stands for unofficial) containing updates that were already being using in production sites. Read more »

Farbtastic is Dead, Long Live Farbtastic

Posted: February 17, 2010 In

Farbtastic is one of those widely used jQuery plugins you may not have realized you were using. One place many people have seen it in action is on Twitter. If you've changed the colors on your twitter page and used the color wheel to select the color you've used it. Farbtastic is the color wheel in Twitter, identi.ca, Drupal, Wordpress, and many other tools and services. While farbtastic is widely used it does have one major problem. Farbtastic is dead. The latest release of Farbtastic is version 1.2 written to work with jQuery 1.0. Remember how long ago that was? Read more »

Putting Password Strength Testers Everywhere

Posted: February 15, 2010 In

I recently saw something terrible happen again. Another website was hacked with a very simple attack. An attack that's been used time and time again. It was a brute force attack trying common usernames and passwords. This is annoying to have to fix, trouble when the server or site is being used for something malicious, and the users feel terrible for being the cause with their weak passwords. There is something we can do about it. We can put password strength testers everywhere someone sets a new password or changes an existing one. Let users know the passwords are weak and what they can do to make them stronger. Read more »

Preloading Images with jQuery and JavaScript

Posted: December 1, 2009 In / 21 Comments

Creating effects on websites using jQuery and other JavaScript has really grown from flashy extras to full on applications in the browser. Part of slick applications is images. They might be part of the content being loaded or something like an icon in an application. But, for those images being added after the page is loaded there can be a time gap while that image is downloaded. To avoid those time delays the images can be preloaded in the background. Lets take a look at how to do that. Read more »

Operating on Features Not Browser Versions

Posted: October 1, 2009 In

modernizr.pngOn of the common patterns in front end web development is to detect the browser and enable site features based on the particular browser being used. With so many different broswers and versions being used and constantly being released this can quickly become a pain. Take just the Yahoo Grade A Browsers plus Google Chrome and you are looking at more than ten browser versions being used. Luckily, there is a better way and it lets us support more browsers than we can think of. Instead of detecting browsers we detect features a browser might have. Read more »