Monday, July 4, 2011

OOP in Javascript

function TaskList(title, wsurl, appType) {
var TaskList = this;
this.Title = title;
this.WSUrl = wsurl;
this.AppType = appType;
}

TaskList.prototype.GetTasks = function() {
alert("Get Tasks!");
}


$(document).ready(function() {
var t = new TaskList("HR Leave System", "http://test.asmx", "Custom Application");
t.GetTasks();
};

No comments:

Post a Comment