Henrique Vicente

Friday, February 09, 2007

Strip me

The day after tomorrow I'm going to post a creatiful way I found to present many tables at once, now a function I'm using there, also you can see there :)

/* Strip before the first underline,
by Henrique Vicente

http://flickr.com/photos/henriquev/
Too cool to be copyrighted
Done after listening to Rape me, by Nirvana
To be used in production environment
Method: child(strip("real_string")); // returns string
*/

function strip(element)
{
var x=0, rape = '', hand = element.split('_');
while(x if(x>1) {
rape +='_';
}
rape += hand[x];
x++;
}
return rape;
}

Labels:



innerHTML from Hell, Firefox sucking again

Firefox just happen to have done a terrible thing again. Now you can use the Microsoft javascript innerHTML proprietary method even with XHTML pages being sent as a xml document, which is from the time of the know browser war between Internet Explorer and Netscape.

How I've figured out
I say now not because it was implemented yesterday or will at the day after tomorrow, but because I've discovered it today that it was NOT standards compliant after I've spent about an entire morning trying to figure out why the heck the Konqueror (which uses the KHTML, the most compliant web standards engine ever and KJS