Javascript

Facebook Like Auto-Suggestion Text Field

Posted in Javascript on April 11th, 2009 by Zaenal M. – Be the first to comment
AutoField Snapshoot

AutoField Snapshoot

AutoTextField or autoField is javascript class for creating auto suggestion input field like gmail or facebook, and required prototype.js version 1.6.0 or above. AutoTextField support mouseOver and some key: ENTER, TAB, END, HOME, UP, DOWN and ESCAPE.

Calling the class is simple: add new AutoField(fieldID, options) to the HEAD of HTML. In the example below, the fieldID is ‘compose_to’, with two options: script for Ajax request and className for CSS layout (you can find complete CSS sample for layout in demo page or download file).
read more »

inspectForm: Unobtrusive Form Validation

Posted in Javascript on December 11th, 2008 by Zaenal M. – Be the first to comment

This script, inspectForm, required Prototype library version 1.6 and above. Some of the features are:

  • unobtrusive
  • client checking
  • server checking with ajax
  • easy to use
  • easy to hack, adjust, extend, modif

read more »

Video: Secrets of JavaScript Closures

Posted in Javascript on December 6th, 2008 by Zaenal M. – Be the first to comment

A must watch presentation! From Fronteers Conference ‘08, Stuart Langridge talks about closures in JavaScript, the secret and the immense power of closure in Javascript. Bring your brain, and a tolerance for jokes. read more »

Multilingual Javascript Date-Format Class

Posted in Javascript on December 1st, 2008 by Zaenal M. – 2 Comments
PHP strftime and Javascript DateFormat class

PHP strftime and Javascript DateFormat class

For PHP developer, it’s will be nice if we can use same date format parameter both in PHP and Javascript. This DateFormat class created for that purpose, since took strftime like parameter to format the output string. For example passing parameter “%d-%m-%Y” will output “dd-mm-yyyy” date string. See also: PHP strftime manual.

DateFormat has standard version and prototype version. The standard version does not required any other library, because it’s developeded under standard Javascript. The prototype version required Prototype library (a least version 1.6). read more »

Compressed prototype.js & scriptaculous.js

Posted in Javascript on November 22nd, 2008 by Zaenal M. – 3 Comments

I compressed both  prototype.js version 1.6.0.2 1.6.1 and scriptaculous.js version 1.8.1 1.8.3 using Javascript Packer by Dean Edward (http://dean.edwards.name/packer/) in one file, and the result is about 95kb.

To reduce more size, just use gzip compression using Apache (mod deflate), PHP (ob_gz) or else. Or you can use Ali Farhadi (http://farhadi.ir/) script, where the code can be downloaded at http://code.google.com/p/smartoptimizer/.

There are two compressed files in the download file:

  • prototype-min.js, compressed prototype (56kb)
  • scriptaculous-min.js, compressed scriptaculous with all modules (47kb) , except unittest.js.
  • The rest is prototype.js, scriptaculous.js and unittest.js.

*** edited on 28 Feb 2010: added protoculous version 1.6.1

Download