roncli.com blog
The blog of roncli
roncli.com blog
roncli.com
blog
Profile
roncli
Houston, Texas, United States
Labels
Coding
CTG Music
Editorials
Games
Miscellaneous
Music
Servers
Silliness
Software
Sports
Trax in Space Beta
Weather
Recent Posts
An excuse
LibWowAPI 1.0.1 - Now on Github!
An experiment in GitHub
#OccupyGregStreet
roncli's Dumbass Award
Cheevos FTW!
LibWowAPI 1.0
LibWow...API? 0.5 beta
LibWowArmory 0.4.1 beta
LibWowArmory 0.4 beta
Sunday, December 18, 2011
jQuery-Default-Button 1.2
Posted: 1:29:00 AM 0 comments
I have committed version 1.2 of my jQuery Default Button plugin to Github just now. This update addresses two issues.

First, I wasn't returning the object, meaning you couldn't do jQuery style chaining with it. Now you can.

The second issue was more obscure, and I probably spent about 2 hours trying to figure this out on a project I've been working on. I am also using the jQuery Tiny Watermark plugin which displays a watermark in an input field when it doesn't have focus. The problem I was running into was that fields that used this watermark would stop responding to the enter key after a while.

It took me a while to figure out the problem. The watermark works by replacing the input boxes every time focus is gained or lost, and every time you replace the input box, it loses its events.

The solution was to let the event bubble up to the containing DIV, check to see if the element causing the event was an INPUT element, and then firing the click event on the target element. Not only does this resolve my problem, but it has the added benefit of using less memory because there's one event handler per form, not one event handler per INPUT on the form.

Labels: ,




0 Comments

Post a Comment