PDA

View Full Version : Javascript Prototyping make things more easier to handle!



rainarts
07-25-2008, 04:22 PM
Making simple things with javascript prototyping! Here's how we do it!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Prototyping</title>
</head>
<body>
<script type="text/javascript">
<!--Hiding
Date.prototype.showTime = function (showMe)
{ var today = new Date();
var month = today.getMonth();
var date = today.getDate();
var year = today.getFullYear();
var outPut = '';
if (showMe)
{ return outPut = month + &quot;/&quot; + date + &quot;/&quot; + &quot;/&quot; + year; }
else { return outPut;
}
}
document.write( showTime(true) );
// Done Hiding -->
</script>
</body>
</html>
That does it for now! If it doesnt work with you pls. lemme know about it. Tnx...