Skip to content

{ Category Archives } jQuery

jQuery and Haskell

I keep telling myself I'll learn Haskell but my brain usually fries halfway through the tutorial. I've always thought that javascript is LISP in C's clothing, and jQuery helps undress it a bit. Now it turns out that really jQuery is really forcing it to cross-dress in Haskell. I guess I understood Haskell all along!

jQuery CSS parser

Updated 2011-02-28; minor bug fix. Thanks, brian! Every time I create or use a jQuery plugin, I realize that the assigning of behaviors to elements on the page is a design decision, not a programming one, and one that should be made by the guy in charge of the CSS, not the guy in charge [...]

gradient on steroids

I was playing with Brandon Aaron's gradient plugin (based on Steven Slayer's gradient) and started adding options and playing with it, so now you can use named colors, percent sizes, and animation. Download the code. See the demo page.

New UI widgets: textpopup and hebrewKeyboard

Last modified 2011-10-28; added box option The Hebrew pop-up keyboard on the YI site search box was always hard-coded and kind of obtrusive, so I wanted to make a jQuery plugin to add a keyboard to any input type="text" or textarea. To make it more flexible, I factored it into a general-purpose popup widget and [...]

Making $.metadata Extensible

With the support for HTML5 data- attributes in jQuery 1.4.3 this plugin is largely obsolete. Metadata I put the idea that the metadata plugin should be extensible out on the jquery discussion group, but it got no attention, so I'm documenting it here.

Extending jQuery UI Widgets, The Final Chapter

This page is obsolete (it uses jQuery UI 1.5). Please see the updated page. OK, this is the final update to the widget subclassing. Rather than creating a new method, $.widget.subclass, I created a single base widget $.ui.widget that does nothing but includes the Aspect-Oriented-Programming code and a subclassing method. I put everything in the [...]

The $.fn.sendkeys Plugin

This post is obsolete. Please see the updated post. The phone pad below is messed up in Internet Explorer. I know. I don't care anymore. The plugin, however, works. $('div.test input:button').click(function(){ $('.output').sendkeys($('div.test input:text').val()); }); $('.phonepad input').click(function(){ $('.output').sendkeys(this.name || this.value); }); $('.output:first').bind('keypress', function(evt){ $('#keypress').text($('#keypress').text()+' '+evt.which); }).bind('sendkeys', function(evt){ $('#sendkeys').text($('#sendkeys').text()+' '+evt.which); }); <div> <textarea class="output"></textarea> <br/> <input type="text" [...]

Testing demo insertion

I added some potentially dangerous code to automatically turn code examples (things in <code> elements with class demo into actual HTML or javascript that are added to the post. The javascript part works; I used it in the last post; here's testing the HTML insertion: <div style="background: purple; margin: 2px">This is a test</div> And more [...]

Extending jQuery UI Widgets Revisited

This page is obsolete (it uses jQuery UI 1.5). Please see the updated page. This is an updated version of a tutorial I wrote a bit back, improved thanks to conversations with Scott Gonzalez of the jQuery UI team. Thanks! Avoiding Bloat in Widgets A while back, Justin Palmer wrote an excellent article on "Avoiding [...]

Testing Chili

I like the idea of syntax coloring, so let's see if Chili works: alert('Hello, world'); and another: <div>Hello, <em>world</em></div> I'm trying to be as HTML5-compliant as possible, at least in the sense of using their standards rather than making up my own, so the Chili setup I'm using is: $.extend(ChiliBook, { automatic: false, codeLanguage: function(el){ [...]