Monday, May 26, 2008

Upcoming experiment - Beautiful URLs with Domino



Just a little preview.. It's a simple "hack". No admins involved :)

More info about well designed URLs

Wednesday, May 14, 2008

StrToken/@Word in JavaScript


function strToken( string, separator, position ){
//If the string doesn't contain the separator, return
//empty string
if( string.indexOf( separator ) == -1 ){ return ''; }

var arr = string.split( separator );

//If the position is larger than the number of elements,
//return empty string
if( position > arr.length ){ return ''; }

//Return found item
return arr[ position - 1 ];
}



Tested in IE6/FF2

Thursday, May 8, 2008

@Unique in Javascript


function arrayUnique( array ){
var uniqueArray = [];

var item;
for( var i = 0, len=array.length ; i < len ; i++ ){
item = array[i];
if( uniqueArray.indexOf( item ) == -1 ){
uniqueArray.push( item );
}
}

return uniqueArray;
}



Tested in IE6/FF2