I'm trying to call a method from inside a Javascript contructor. Here's an example:
function team(team_id) {
this.team_id = team_id;
init();
this.init = function () {
alert('testing this out: ' + this.team_id);
};
}
var my_team = new team(15);
Also: http://jsfiddle.net/N8Rxt/2/
This doesn't work. The alert is never displayed. Any ideas? Thanks.