psc_stats: There was an error while add allocation for measure with ID '2342' and topic with ID '2'.Duplicate entry '2342-2' for key 'PRIMARY'
psc_stats: There was an error while add allocation for measure with ID '2342' and topic with ID '3'.Duplicate entry '2342-3' for key 'PRIMARY'

Aktion “Stoppt die Vorratsdatenspeicherung”

Willst du auch bei der Aktion teilnehmen? Hier findest du alle relevanten Infos und Materialien:
Wednesday, 13. June 2007 - 00:07

Mini-Introduction to objectorientated javascript

Dieser Beitrag ist auch in deutsch verfügbar (empfohlen).


function class()
{
	this.foo='foo';			//public member
	var bar='bar';			//private member
	alert("I'm a contstructor.");
	
	this.baz=function ()		//public method
	{
		alert(bar);		//accessing private member
		alert(this.foo);	//accessing public member
		bam();			//calling private method
	}
	
	function foba()
	{
		alert("I'm so public");
	}
	this.foba=foba;
	
	var bam=function()		//private method
	{
		alert('Huchee!');
	}
	
	alert("I'm still a contstructor.");
}

var c=new class();
c.baz();
c.foba();

Filed under: Webdev
Technorati Tags:

Embassies

  1. Sebastian (Website) wrote at 16/03/09 - 10:58:45
    Superhilfe, endlich mal ein Beispiel für objectorientiertes Javascript, das man versteht. Kurz, knapp ... super

    Gruss

    Sebastian
  2. Ethel wrote at 26/10/10 - 15:32:48
    Dito! Danke

Comment entry

Personal informations

Spam protection:

Trackback(s)

What's trackback?

A trackback is a kind of a source link. If i was finding an interesting entry in another blog, that i am commenting in my own blog, i am linking to the original message via the trackback. Has someone commented one of my entries in his/her weblog, you can find this link here under trackbacks, too. More informations about trackback are in the Wikipedia for example.

Trackback URL: http://geeks-have-feelings-too.net/trackback/mini-introduction-to-objectorientated-javascript/

There are no trackbacks for this entry.

Sidebar

Recent acoustic enchantment

Clare Burson - Love Me In The Morning

Random Thought

There's no place like 127.0.0.1

Change the emotion

Firefox Add to Technorati Favorites