Skip to content

{ Monthly Archives } January 2015

Updated $.fn.status

I've added the ability to use the console with my status plugin, so you can do $(console).status({ run: $.post(url, {data: data}).then( function() { return 'Data Saved' }, function() { return new Error('Data Not saved') } ) }); And the output will go to the console rather than to an element on the page. For simple […]

Rethinking $.fn.sendkeys

See the demo. See the source code, which depends on bililiteRange. Modern browsers won't let synthetic events (triggered with dispatchEvent) execute their default actions (meaning the action that would occur if the event was triggered by a user action). The Event object has a read-only field called isTrusted that is false for anything but unmodified […]


bililiteRange.text() works well to insert text into ranges, but I wanted to be able to simulate other keys, ala Microsoft's SendKeys. bililiteRange.sendkeys() does exactly that. It basically executes text(string, 'end') but interprets any text between braces ('{key}') as a command representing a special key. For security reasons, the browser won't let you do anything outside […]

Rethinking $.keymap

Download the code. See the demo. See the hotkeys demo. Dealing with keydown events is a pain, since the event object has always encoded the key as an arbitrary numeric code, so any program that deals with key-related events has something like: var charcodes = { 32 : ' ', 8 : 'Backspace', 20 : […]