All posts tagged jQuery

Faster jQuery Selector Calls with Chaining

Rob Tarr ran some benchmarks to prove the claim that chaining jQuery selector methods is faster than placing them all in a single method call.

Passing Extra Arguments to a jQuery Event Handler

This Fiddle shows how to pass extra parameters to an event handler function in jQuery.

admin-ajax.php Response Fails When Called from Domain Alias

I’m writing a WordPress plugin that uses AJAX and I had everything setup and working fine for awhile. I came back to the code a few hours later and all of the sudden I was getting a failed response, even though the code hadn’t changed. I got the correct JSON response when I loaded the… [more]

jQuery document.ready() Fires Twice

There’s a bug in jQuery 1.4.3 that causes document.ready() to fire twice if there’s an unhanded exception. You can avoid it by wrapping the code that is throwing the exception inside a try/catch block.

IE Pixelates Text During Javascript Animations

If you’re performing a JavaScript animation effect on an element (e.g., jQuery’s fadeIn/fadeOut), you may notice that the text briefly pixelates in IE . You can fix that by setting a background color on the element.

Cross-Domain AJAX Requests

Browsers prevent standard AJAX calls across domains for security reasons, but you can make JSONP calls instead. If you’re using jQuery you just need to add ‘callback=?’ to the url: Then setup the request handler to prepend the callback parameter to the response and wrap it in quotes: If you’re using Firebug to monitor the… [more]

Alternatives to Select/Multiple

Ryan Cramer details some of the problems with select/multiple and a few good alternatives . It’s useful in certain circumstances, but unintuitive and error-prone. Instead, you can create a list of checkboxes inside an element with overflow:auto set, or use a jQuery plugin he developed.

 
re-abolish slavery