<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How to do class functions in javascript (aka static or shared functions)</title>
	<atom:link href="http://www.javascriptkata.com/2007/03/26/how-to-do-class-functions-in-javascript-aka-static-or-shared-functions/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.javascriptkata.com/2007/03/26/how-to-do-class-functions-in-javascript-aka-static-or-shared-functions/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-do-class-functions-in-javascript-aka-static-or-shared-functions</link>
	<description>helping you with javascript since 2007</description>
	<lastBuildDate>Tue, 31 Jan 2012 11:22:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Joseph Bolla</title>
		<link>http://www.javascriptkata.com/2007/03/26/how-to-do-class-functions-in-javascript-aka-static-or-shared-functions/comment-page-1/#comment-1434</link>
		<dc:creator>Joseph Bolla</dc:creator>
		<pubDate>Mon, 16 Jan 2012 15:36:00 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=13#comment-1434</guid>
		<description>You could Implement Polymorphism like this in JavaScript:

/** This is our Person class */

        Person = function (id, name, age) {
            this.id = id;
            this.name = name;
            this.age = age;
           // alert(&#039;A new person has been accepted&#039;);
        }

        /* definition of our Person class */
        Person.prototype = {
            /** wake person up */
            wake_up: function () {
                alert(&#039;A person is awake&#039;);
            },

            /** retrieve person&#039;s age */
            get_age: function () {
                return this.age;
            }
        }

        Inheritance_Manager = {};

        Inheritance_Manager.extend = function (subClass, baseClass) {
            function inheritance() { }
            inheritance.prototype = baseClass.prototype;
            subClass.prototype = new inheritance();
            subClass.prototype.constructor = subClass;
            subClass.baseConstructor = baseClass;
            subClass.superClass = baseClass.prototype;
        }



        Manager = function (id, name, age, salary) {
            Manager.baseConstructor.call(this, id, name, age);
            this.salary = salary;
           // alert(&#039;A manager has been registered.&#039;);
        }

        Inheritance_Manager.extend(Manager, Person);

        Manager.prototype = {
            wake_up: function () {
                alert(&#039;I am in control&#039;);
            }
        }

        var arrPeople = new Array();
        arrPeople[0] = new Person(1, &#039;Joe Tester&#039;, 26);
        arrPeople[1] = new Manager(1, &#039;Joe Tester&#039;, 26, &#039;20.000&#039;);

        for (var i in arrPeople) {
            arrPeople[i].wake_up();
            alert(arrPeople[i].get_age());
        }


View full article with comments: &lt;a href=&quot;http://www.cyberminds.co.uk/blog/articles/polymorphism-in-javascript.aspx&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;
 </description>
		<content:encoded><![CDATA[<p>You could Implement Polymorphism like this in JavaScript:</p>
<p>/** This is our Person class */</p>
<p>        Person = function (id, name, age) {<br />
            this.id = id;<br />
            this.name = name;<br />
            this.age = age;<br />
           // alert(&#8216;A new person has been accepted&#8217;);<br />
        }</p>
<p>        /* definition of our Person class */<br />
        Person.prototype = {<br />
            /** wake person up */<br />
            wake_up: function () {<br />
                alert(&#8216;A person is awake&#8217;);<br />
            },</p>
<p>            /** retrieve person&#8217;s age */<br />
            get_age: function () {<br />
                return this.age;<br />
            }<br />
        }</p>
<p>        Inheritance_Manager = {};</p>
<p>        Inheritance_Manager.extend = function (subClass, baseClass) {<br />
            function inheritance() { }<br />
            inheritance.prototype = baseClass.prototype;<br />
            subClass.prototype = new inheritance();<br />
            subClass.prototype.constructor = subClass;<br />
            subClass.baseConstructor = baseClass;<br />
            subClass.superClass = baseClass.prototype;<br />
        }</p>
<p>        Manager = function (id, name, age, salary) {<br />
            Manager.baseConstructor.call(this, id, name, age);<br />
            this.salary = salary;<br />
           // alert(&#8216;A manager has been registered.&#8217;);<br />
        }</p>
<p>        Inheritance_Manager.extend(Manager, Person);</p>
<p>        Manager.prototype = {<br />
            wake_up: function () {<br />
                alert(&#8216;I am in control&#8217;);<br />
            }<br />
        }</p>
<p>        var arrPeople = new Array();<br />
        arrPeople[0] = new Person(1, &#8216;Joe Tester&#8217;, 26);<br />
        arrPeople[1] = new Manager(1, &#8216;Joe Tester&#8217;, 26, &#8217;20.000&#8242;);</p>
<p>        for (var i in arrPeople) {<br />
            arrPeople[i].wake_up();<br />
            alert(arrPeople[i].get_age());<br />
        }</p>
<p>View full article with comments: <a href="http://www.cyberminds.co.uk/blog/articles/polymorphism-in-javascript.aspx" rel="nofollow">here</a><br />
 </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wedding DJ</title>
		<link>http://www.javascriptkata.com/2007/03/26/how-to-do-class-functions-in-javascript-aka-static-or-shared-functions/comment-page-1/#comment-1421</link>
		<dc:creator>Wedding DJ</dc:creator>
		<pubDate>Thu, 10 Nov 2011 00:27:00 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=13#comment-1421</guid>
		<description>I&#039;ll see if I can use it on my [url=http://www.jmfdisco.co.uk]Wedding DJ[/url] website</description>
		<content:encoded><![CDATA[<p>I&#8217;ll see if I can use it on my [url=http://www.jmfdisco.co.uk]Wedding DJ[/url] website</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sleeve tattoo designs</title>
		<link>http://www.javascriptkata.com/2007/03/26/how-to-do-class-functions-in-javascript-aka-static-or-shared-functions/comment-page-1/#comment-1184</link>
		<dc:creator>sleeve tattoo designs</dc:creator>
		<pubDate>Thu, 05 May 2011 17:08:05 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=13#comment-1184</guid>
		<description>calling LoadControl isn&#039;t seen by the compiler as being an explicit instance of the class. What&#039;s not explicit about using LoadControl to create a new control from a file. tried creating a new user control and initializing it, then setting it to a different control with LoadControl to no avail.</description>
		<content:encoded><![CDATA[<p>calling LoadControl isn&#39;t seen by the compiler as being an explicit instance of the class. What&#39;s not explicit about using LoadControl to create a new control from a file. tried creating a new user control and initializing it, then setting it to a different control with LoadControl to no avail.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kelas Statis pada Javascript &#124; Welcome to Rezan&#039;s Blog</title>
		<link>http://www.javascriptkata.com/2007/03/26/how-to-do-class-functions-in-javascript-aka-static-or-shared-functions/comment-page-1/#comment-1169</link>
		<dc:creator>Kelas Statis pada Javascript &#124; Welcome to Rezan&#039;s Blog</dc:creator>
		<pubDate>Fri, 08 Apr 2011 11:48:55 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=13#comment-1169</guid>
		<description>[...] Referensi : http://www.javascriptkata.com/2007/03/26/how-to-do-class-functions-in-javascript-aka-static-or-share... [...]</description>
		<content:encoded><![CDATA[<p>[...] Referensi : <a href="http://www.javascriptkata.com/2007/03/26/how-to-do-class-functions-in-javascript-aka-static-or-share.." rel="nofollow">http://www.javascriptkata.com/2007/03/26/how-to-do-class-functions-in-javascript-aka-static-or-share..</a>. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: toronto wedding dj</title>
		<link>http://www.javascriptkata.com/2007/03/26/how-to-do-class-functions-in-javascript-aka-static-or-shared-functions/comment-page-1/#comment-1132</link>
		<dc:creator>toronto wedding dj</dc:creator>
		<pubDate>Mon, 21 Mar 2011 16:29:46 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=13#comment-1132</guid>
		<description>If you define a class method (not an instance method) called init it will be automatically called when the class is created. Constructor functions are never called during the prototyping phase (subclassing).&lt;br&gt;</description>
		<content:encoded><![CDATA[<p>If you define a class method (not an instance method) called init it will be automatically called when the class is created. Constructor functions are never called during the prototyping phase (subclassing).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: How to make a singleton in javascript &#124; Javascript Kata</title>
		<link>http://www.javascriptkata.com/2007/03/26/how-to-do-class-functions-in-javascript-aka-static-or-shared-functions/comment-page-1/#comment-801</link>
		<dc:creator>How to make a singleton in javascript &#124; Javascript Kata</dc:creator>
		<pubDate>Thu, 01 Oct 2009 15:11:11 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=13#comment-801</guid>
		<description>[...] Before writing a singleton, you need to know about creating objects and static functions. [...]</description>
		<content:encoded><![CDATA[<p>[...] Before writing a singleton, you need to know about creating objects and static functions. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Octoberdan</title>
		<link>http://www.javascriptkata.com/2007/03/26/how-to-do-class-functions-in-javascript-aka-static-or-shared-functions/comment-page-1/#comment-33</link>
		<dc:creator>Octoberdan</dc:creator>
		<pubDate>Thu, 14 Jun 2007 16:15:15 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=13#comment-33</guid>
		<description>Thank you though for the help. It pointed me in the right direction...</description>
		<content:encoded><![CDATA[<p>Thank you though for the help. It pointed me in the right direction&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Octoberdan</title>
		<link>http://www.javascriptkata.com/2007/03/26/how-to-do-class-functions-in-javascript-aka-static-or-shared-functions/comment-page-1/#comment-32</link>
		<dc:creator>Octoberdan</dc:creator>
		<pubDate>Thu, 14 Jun 2007 16:14:44 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=13#comment-32</guid>
		<description>[code]
 Calendar.readableTime = new function() {
     // Code here
 }
[/code]

Should be

[code]
 Calendar.readableTime = function() {
     // Code here
 };
[/code]</description>
		<content:encoded><![CDATA[<p>[code]<br />
 Calendar.readableTime = new function() {<br />
     // Code here<br />
 }<br />
[/code]</p>
<p>Should be</p>
<p>[code]<br />
 Calendar.readableTime = function() {<br />
     // Code here<br />
 };<br />
[/code]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

