View Single Post
  #6 (permalink)  
Old 10-11-2007, 12:08 AM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Default Re: OnClick event for dynamic table?

Ya Sure,..

Code:
function Calendar(){
	this.monthNames = new Array("January","February",....);
	this.monthDays = new Array(31,28,31,30,31,30,31,....);
	this.daysOfWeek = "SMTWTFS";
	this.currentDate = new Date();
	this.currentMonth = this.currentDate.getMonth();
	this.currentYear = this.currentDate.getFullYear();
}

Calendar.prototype.changeMonth = function(month){
}

Calendar.prototype.buildCalendar = function(){
        ............
	var currentTD = document.createElement("td");
	currentTD.className = "calendarNav";
	currentTD.appendChild(document.createTextNode("<"));
	currentTR.appendChild(currentTD);
        ............
}

Calendar.prototype.leapCheck = function(year){
}

var cal = new Calendar();
cal.buildCalendar();
and calling in the html is,

Code:
<body>
<script language = 'JavaScript' type = 'text/javascript' src = '/class/class_Calendar.js'>
</script>
</body>
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Reply With Quote