JavaScript category archives

elementReady: a jQuery plugin

I have written a simple but useful jQuery plugin. elementReady calls a function during page load as soon as a specific element is available — even before the full DOM is loaded. It’s useful if you have unobtrusive JavaScript that you want to apply to particular page elements immediately, without having to wait for the […]

Share This (jQuery): a WordPress plugin

I have made a useful modification to Alex King’s excellent Share This WordPress plugin. Share This adds a nice popup to your posts allowing readers to easily submit the post to any number of social networking and news sites. The original version relies on the large Prototype JavaScript library, which adds to the download size […]

Be careful with JavaScript variable declarations

Make sure you declare all your JavaScript variables exactly once. Otherwise it’s easy to introduce bugs that are hard to diagnose, especially if you’re used to programming in a C-like language such as Java, C++ or C#.

Optimised jQuery Corners plugin

I’ve created an optimised version of Dave Methvin’s excellent jQuery corner plugin. This allows jQuery users to apply all sorts of fancy effects to the corners of web page elements: the now-standard Web 2.0 rounded corners, bevels, dog-ears and many more. The plugin works by injecting extra elements into the page, and I noticed a […]

Setting the “name” attribute in Internet Explorer

I have recently needed to write code that uses JavaScript to add elements dynamically to a web page on the client. I read the relevant W3C documents and wrote the code, and it seemed to work fine. Until I tried it on Internet Explorer. After some digging, I found an explanation in the MSDN DHTML […]

Close
E-mail It