Ca-Phun Ung

Freelance web developer and Internet consultant at Yelotofu.
Categories
- Accessibility (6)
- Browser Testing (5)
- CSS (11)
- Django (3)
- Events (5)
- Hong Kong (3)
- JavaScript (18)
- Labs (2)
- Optimisation (2)
- PHP (8)
- Ramblings (12)
- Reviews (6)
- Ruby on Rails (4)
- Tools (5)
- Web Standards (10)
- WiFi (3)
jQuery Inline Edit tutorial
A friend recently asked me to review his edit-in-place code which turned out to be a modification of the one found at http://docs.jquery.com/Tutorials:Edit_in_Place_with_Ajax. Reading the tutorial on that page I asked myself how I would do this differently? Defining a global setClickable() function and then calling $(‘#editInPlace”).click() is totally uncool, essentially limiting yourself to one [...]
jQuery: Shuffle Plugin
I recently came across a really compact array shuffling function on JSFromHell.com, which I thought would make a nifty jQuery plugin. This jQuery shuffle plugin could be applied to any HTML element or Array object. (function($){ $.fn.shuffle = function() { return this.each(function(){ var items = $(this).children(); return (items.length) ? $(this).html($.shuffle(items)) : this; }); } $.shuffle [...]
jQuery: outerHTML
The outerHTML property (IE only) could sometimes be very handy, especially if you’re trying to replace an element entirely. Brandon Aaron has very kindly given us a outerHTML plugin that does half the job as it doesn’t support replacements. The following code snippet fills in the blanks: jQuery.fn.outerHTML = function(s) { return (s) ? this.before(s).remove() [...]