Restore Value for Input Using Savvy.UI

Posted on the September 21st, 2008 under JavaScript, Programming, Savvy.UI, Tutorial by Zaki

Let make it short this time, Here’s a snippet code to allow you to use the input fields (either text or password) to display the input description without interfering the application, not only will it hide the label when user focus on the field but also show the label back when user leave the field without adding any text.

3 JavaScript Regular Expression for Malaysia Data Format

Posted on the September 17th, 2008 under JavaScript, Programming, Q&A, Tutorial by Zaki

Question

Can you share with us the proper Regular Expression (RegExp) for Malaysia’s data format as the following:

  • Identification Card
  • Postcode
  • Phone Number

Invoking Savvy.UI DOMElements Object

Posted on the September 7th, 2008 under Programming, Savvy.UI, Tutorial by Zaki

Question

How many way can I invoke Savvy.UI DOMElements Object using Savvy.UI CSS Query Selector, a feature which is norm in any JavaScript Framework today?

Display Twitter Status in Your Website Using Savvy.UI

Posted on the September 5th, 2008 under JavaScript, Programming, Savvy.UI, Tutorial by Zaki

This tutorial is a continuation of my previous tutorial Display Random Text in Your Website Using Savvy.UI but instead of random text this time we will display your latest Twitter Status. The tutorial is based on the Twitter Badge for HTML.

Display Random Text in Your Website Using Savvy.UI

Posted on the September 4th, 2008 under JavaScript, Programming, Savvy.UI, Tutorial by Zaki

What your opinion to the random text appearing at the upper right corner of this blog? Would like to have one too? Savvy.UI JavaScript Library has made it easy for you to display message or note without interfering the user view of the application using Js.widget.message object.

Hide E-mail Address From Spammer in HTML

Posted on the September 2nd, 2008 under JavaScript, Programming, Savvy.UI, Tutorial by Zaki

There’re multiple way to hide E-mail Address in your HTML page from being fetch/grab by spammer, today let me show you one way of doing it using simple JavaScript and Savvy.UI JavaScript Library.

Email me to <span class="mailto"></span>

Here’s an example how you can transform all span.mailto to display and link an e-mail.

Js.simplify();
var email = ["zaki","codenitive.com"].join("@"); // just edit this line;
 
$(document).ready(function() {
	$("span.mailto").each(function() {
		$(this).add("a", {
			href: "mailto:" + email,
			title: "Email to " + email
		}).text(email);
	});
});

Copying JavaScript Object Without Adding Reference

Posted on the August 28th, 2008 under JavaScript, Programming, Q&A, Savvy.UI by Zaki

Question

How to copy a JavaScript Object without adding the reference to the object it copy from? For example:

var user = {
	name: "Mior Muhammad Zaki",
	age: 25
};
var programmer = user;
programmer.language = ["PHP", "MySQL", "JavaScript"];
alert(user.language);
// return ["PHP", "MySQL", "JavaScript"] (when expect undefined)

Combining Multiple Table Columns in MySQL

Posted on the August 25th, 2008 under MySQL, Programming, Q&A, Tutorial by Zaki

Question

How to combine address1, address2, address3 and address4 in the following table to a single column such as address?

CREATE TABLE user (
`id` INT NOT NULL AUTO_INCREMENT ,
`name` VARCHAR( 255 ) NOT NULL ,
`email` VARCHAR( 255 ) NOT NULL ,
`address1` VARCHAR( 100 ) NOT NULL ,
`address2` VARCHAR( 100 ) NOT NULL ,
`address3` VARCHAR( 100 ) NOT NULL ,
`address4` VARCHAR( 100 ) NOT NULL ,
`postcode` VARCHAR( 6 ) NOT NULL ,
`state` VARCHAR( 100 ) NOT NULL ,
PRIMARY KEY ( `id` )
) ENGINE = MYISAM;

Twitter Site Post Bookmarklet

Posted on the July 24th, 2008 under Browser, JavaScript, Tutorial by Zaki

Normally you have to copy the URL of site and paste it in your Twitter but now there’s a simple bookmarklet that I made to be use with Twitter which allow you to post site hyperlink.

javascript:window.location="http://twitter.com/home?status="+window.location.href;

First of all, drag the following link to your Bookmark Toolbar: Twitter Site Post.

Now you can visit any page, and if your interested to share it in Twitter just click the Bookmark button.

Generating Thumbnail Using SnapCasa

Posted on the June 5th, 2008 under PHP, Programming, Tutorial by Zaki

In this tutorial I will share with you on how to create a generated thumbnail of website store at your own webserver without having to depend on 3rd party provider to repeatly load thumbnails overtime. For the tutorial I will show you how to generate site thumbnail using PHP and SnapCasa.com.