It’s often much more efficient to access DOM properties directly , rather than using jQuery. The downside to that approach is that there are differences between the various browsers, so in some cases it introduces bigger problems than the extra performance overhead.
All posts tagged jQuery
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.
This Fiddle shows how to pass extra parameters to an event handler function in jQuery.
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]
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.
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]
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.