What's Wrong With This Code? (#28)
Posted by: K. Scott Allen,
on 15 Aug 2011 |
View original | Bookmarked: 0 time(s)
Victor Brumble is writing code again, and this time he's writing a jQuery plugin. His plugin makes alert boxes easy, because Victor loves pointless, model dialogs. (function ($) {
var settings = {
text: 'Thank you for clicking!'
};
$.fn.alerter = function (options) {
return this.each(function () {
if (options) {
$.extend(settings, options);
}
$(this).click(function () {
alert(settings.text);
...