<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>JavascriptKata - Latest Comments</title><link xmlns="http://www.w3.org/2005/Atom" rel="http://api.friendfeed.com/2008/03#sup" href="http://disqus.com/sup/all.sup#forumcomments-67ab8788" type="application/json"/><link>http://javascriptkata.disqus.com/</link><description></description><atom:link href="http://javascriptkata.disqus.com/comments.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Thu, 03 May 2012 16:44:11 -0000</lastBuildDate><item><title>Re: How to write javascript code to fit in lines of 80 chars</title><link>http://www.javascriptkata.com/2012/04/30/how-to-write-javascript-code-to-fit-in-lines-of-80-chars/#comment-518001222</link><description>&lt;p&gt;yeah, I made a mistake. He discovered JSON under a rock...&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">dsimard</dc:creator><pubDate>Thu, 03 May 2012 16:44:11 -0000</pubDate></item><item><title>Re: How to write javascript code to fit in lines of 80 chars</title><link>http://www.javascriptkata.com/2012/04/30/how-to-write-javascript-code-to-fit-in-lines-of-80-chars/#comment-517976867</link><description>&lt;p&gt;"&lt;br&gt;the guy that discovered Ajax" - WRONG&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Foo</dc:creator><pubDate>Thu, 03 May 2012 16:10:21 -0000</pubDate></item><item><title>Re: How to make a singleton in javascript</title><link>http://www.javascriptkata.com/2007/04/04/how-to-make-a-singleton/#comment-508151007</link><description>&lt;p&gt;Nice "homerule"&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">David Suarez</dc:creator><pubDate>Tue, 24 Apr 2012 16:06:54 -0000</pubDate></item><item><title>Re: How to execute javascript code directly in your browser</title><link>http://www.javascriptkata.com/2007/05/01/execute-javascript-code-directly-in-your-browser/#comment-507595250</link><description>&lt;p&gt;Thanks!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ssstonc</dc:creator><pubDate>Mon, 23 Apr 2012 23:22:25 -0000</pubDate></item><item><title>Re: How to execute javascript code directly in your browser</title><link>http://www.javascriptkata.com/2007/05/01/execute-javascript-code-directly-in-your-browser/#comment-467875424</link><description>&lt;p&gt;hi i can't  still open it,  javascript:ajaxpage("ajaxonly.php","contentarea")/;void(0);&lt;br&gt;is it correct?&lt;br&gt;thx&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Hahah</dc:creator><pubDate>Sat, 17 Mar 2012 14:09:17 -0000</pubDate></item><item><title>Re: How to have jQuery and prototype.js in the same project</title><link>http://www.javascriptkata.com/2008/01/28/how-to-have-jquery-and-prototypejs-in-the-same-project/#comment-461786875</link><description>&lt;p&gt;What if I add a third party library of jquery, they'd be using $ as usual. Conflicts!!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Yasir</dc:creator><pubDate>Sat, 10 Mar 2012 19:13:26 -0000</pubDate></item><item><title>Re: How to execute javascript code directly in your browser</title><link>http://www.javascriptkata.com/2007/05/01/execute-javascript-code-directly-in-your-browser/#comment-454481001</link><description>&lt;p&gt; no.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">hikingmike</dc:creator><pubDate>Fri, 02 Mar 2012 09:34:25 -0000</pubDate></item><item><title>Re: How to execute javascript code directly in your browser</title><link>http://www.javascriptkata.com/2007/05/01/execute-javascript-code-directly-in-your-browser/#comment-452344241</link><description>&lt;p&gt;for executing java script we need tomcat server(any server) Is it right?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Maniallfines</dc:creator><pubDate>Wed, 29 Feb 2012 09:18:07 -0000</pubDate></item><item><title>Re: How to do class functions in javascript (aka static or shared functions)</title><link>http://www.javascriptkata.com/2007/03/26/how-to-do-class-functions-in-javascript-aka-static-or-shared-functions/#comment-412623661</link><description>&lt;p&gt;You could Implement Polymorphism like this in JavaScript:&lt;/p&gt;

&lt;p&gt;/** This is our Person class */&lt;/p&gt;

&lt;p&gt;        Person = function (id, name, age) {&lt;br&gt;            &lt;a href="http://this.id" rel="nofollow"&gt;this.id&lt;/a&gt; = id;&lt;br&gt;            &lt;a href="http://this.name" rel="nofollow"&gt;this.name&lt;/a&gt; = name;&lt;br&gt;            this.age = age;&lt;br&gt;           // alert('A new person has been accepted');&lt;br&gt;        }&lt;/p&gt;

&lt;p&gt;        /* definition of our Person class */&lt;br&gt;        Person.prototype = {&lt;br&gt;            /** wake person up */&lt;br&gt;            wake_up: function () {&lt;br&gt;                alert('A person is awake');&lt;br&gt;            },&lt;/p&gt;

&lt;p&gt;            /** retrieve person's age */&lt;br&gt;            get_age: function () {&lt;br&gt;                return this.age;&lt;br&gt;            }&lt;br&gt;        }&lt;/p&gt;

&lt;p&gt;        Inheritance_Manager = {};&lt;/p&gt;

&lt;p&gt;        Inheritance_Manager.extend = function (subClass, baseClass) {&lt;br&gt;            function inheritance() { }&lt;br&gt;            inheritance.prototype = baseClass.prototype;&lt;br&gt;            subClass.prototype = new inheritance();&lt;br&gt;            subClass.prototype.constructor = subClass;&lt;br&gt;            subClass.baseConstructor = baseClass;&lt;br&gt;            subClass.superClass = baseClass.prototype;&lt;br&gt;        }&lt;/p&gt;

&lt;p&gt;        Manager = function (id, name, age, salary) {&lt;br&gt;            Manager.baseConstructor.call(this, id, name, age);&lt;br&gt;            this.salary = salary;&lt;br&gt;           // alert('A manager has been registered.');&lt;br&gt;        }&lt;/p&gt;

&lt;p&gt;        Inheritance_Manager.extend(Manager, Person);&lt;/p&gt;

&lt;p&gt;        Manager.prototype = {&lt;br&gt;            wake_up: function () {&lt;br&gt;                alert('I am in control');&lt;br&gt;            }&lt;br&gt;        }&lt;/p&gt;

&lt;p&gt;        var arrPeople = new Array();&lt;br&gt;        arrPeople[0] = new Person(1, 'Joe Tester', 26);&lt;br&gt;        arrPeople[1] = new Manager(1, 'Joe Tester', 26, '20.000');&lt;/p&gt;

&lt;p&gt;        for (var i in arrPeople) {&lt;br&gt;            arrPeople[i].wake_up();&lt;br&gt;            alert(arrPeople[i].get_age());&lt;br&gt;        }&lt;/p&gt;

&lt;p&gt;View full article with comments: &lt;a href="http://www.cyberminds.co.uk/blog/articles/polymorphism-in-javascript.aspx" rel="nofollow"&gt;here&lt;/a&gt;&lt;br&gt; &lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Joseph Bolla</dc:creator><pubDate>Mon, 16 Jan 2012 10:36:26 -0000</pubDate></item><item><title>Re: How to make sure undefined is not defined</title><link>http://www.javascriptkata.com/2011/09/13/how-to-make-sure-undefined-is-not-defined/#comment-406827492</link><description>&lt;p&gt;undefined = false; &lt;br&gt;console.log(undefined.toString());//firebug console error "undefined has no properties"&lt;br&gt;(function(undefined) { console.log(typeof undefined); })(); &lt;/p&gt;

&lt;p&gt;why?&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">李 鹏</dc:creator><pubDate>Mon, 09 Jan 2012 23:58:12 -0000</pubDate></item><item><title>Re: How to inherit classes in javascript</title><link>http://www.javascriptkata.com/2007/05/22/how-to-inherit-classes-in-javascript/#comment-405466108</link><description>&lt;p&gt;Here is a simple way to implement inheritance in Javascript:&lt;br&gt;Person = function(id, name, age){    &lt;a href="http://this.id" rel="nofollow"&gt;this.id&lt;/a&gt; = id;    &lt;a href="http://this.name" rel="nofollow"&gt;this.name&lt;/a&gt; = name;    this.age = age;    alert('A new person has been accepted');}Person.prototype = {    /** wake person up */    wake_up: function() {        alert('I am awake');    },    /** retrieve person'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('A manager has been registered.');}Inheritance_Manager.extend(Manager, Person);Manager.prototype.lead = function(){   alert('I am a good leader');}var p = new Person(1, 'Joe Tester', 26);var pm = new Manager(1, 'Joe Tester', 26, '20.000');&lt;/p&gt;

&lt;p&gt;alert(&lt;a href="http://p.name" rel="nofollow"&gt;p.name&lt;/a&gt;);alert(pm.salary);View all code here with demos:&lt;br&gt;&lt;a href="http://www.cyberminds.co.uk/blog/articles/how-to-implement-javascript-inheritance.asp" rel="nofollow"&gt;http://www.cyberminds.co.uk/bl...&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Joe_bolla</dc:creator><pubDate>Sun, 08 Jan 2012 16:04:21 -0000</pubDate></item><item><title>Re: How to inherit classes in javascript</title><link>http://www.javascriptkata.com/2007/05/22/how-to-inherit-classes-in-javascript/#comment-391785484</link><description>&lt;p&gt;Try this simple example &lt;a href="http://www.cyberminds.co.uk/blog/articles/how-to-implement-javascript-inheritance.aspx" rel="nofollow"&gt;http://www.cyberminds.co.uk/bl...&lt;/a&gt;&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Joe_bolla</dc:creator><pubDate>Wed, 21 Dec 2011 16:38:48 -0000</pubDate></item><item><title>Re: Do not use the innerHTML property on HTML objects</title><link>http://www.javascriptkata.com/2007/04/17/do-not-use-the-innerhtml-property-on-html-objects/#comment-391540235</link><description>&lt;p&gt;i need same add new comment code&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sviswa</dc:creator><pubDate>Wed, 21 Dec 2011 13:13:44 -0000</pubDate></item><item><title>Re: Ask Dan a javascript question : first edition</title><link>http://www.javascriptkata.com/2007/06/01/ask-dan-a-javascript-question-first-edition/#comment-381729039</link><description>&lt;p&gt;How to make a dice game for two player in javascript and html using just two dice?&lt;/p&gt;

&lt;p&gt;1. Each player throws both dice once per turn. You only score if you &lt;br&gt;throw doubles (that is, both dice have the same number of spots on their&lt;br&gt; top face).&lt;br&gt;2. Players score five points for double ones, twos, &lt;br&gt;fours or fives. A double six scores twenty five points, but if you throw&lt;br&gt; a double three your score goes back to zero.&lt;br&gt;3. Add your score as&lt;br&gt; you play. The first player to get fifty points wins the game. (An adult&lt;br&gt; or older child may need to help score, but you can use this game to &lt;br&gt;teach younger children to count by fives.)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Guest</dc:creator><pubDate>Wed, 07 Dec 2011 21:50:36 -0000</pubDate></item><item><title>Re: How to use the self with object-oriented javascript and closures</title><link>http://www.javascriptkata.com/2007/05/14/how-to-use-the-self-with-object-oriented-javascript-and-closures/#comment-379509302</link><description>&lt;p&gt;Awsome&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Michel Jansma</dc:creator><pubDate>Mon, 05 Dec 2011 09:51:49 -0000</pubDate></item><item><title>Re: Do not use the innerHTML property on HTML objects</title><link>http://www.javascriptkata.com/2007/04/17/do-not-use-the-innerhtml-property-on-html-objects/#comment-376814981</link><description>&lt;p&gt;That is NOT the best idea. The best idea is to work with the DOM. Adding 20,000 lines of jQuery magic to do what you can already do in plain-jane vanilla javascript is not only bad practice, it is a detrimental to your skills as a developer. Use the standard DOM methods and you can't go wrong.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Chris Baker</dc:creator><pubDate>Thu, 01 Dec 2011 12:30:29 -0000</pubDate></item><item><title>Re: Cleanest way of executing javascript code on page load</title><link>http://www.javascriptkata.com/2008/12/01/cleanest-way-of-executing-javascript-code-on-page-load/#comment-336292842</link><description>&lt;p&gt;I stumbled on this page via Google search and reading the comments it sounds like this is a smart group.  I'm a complete newbie to Javascript, AJAX, and PHP and I'm trying to figure out a way of passing on a data-value to a page when it loads and then use that data-value with a javascript that runs when the page loads.&lt;/p&gt;

&lt;p&gt;I bought a WordPress template that the author stopped supporting and I need to find a solution to this problem.  If you go to &lt;a href="http://www.stevenmichaeloconnor.com/series" rel="nofollow"&gt;http://www.stevenmichaeloconno...&lt;/a&gt; I am trying to get it so that if someone clicks on a Series Name such as "Assorted" it would go to the Portfolio page and then execute the javascript that the category menu is using and pass along the data-value="assorted".&lt;/p&gt;

&lt;p&gt;This is the a href that the category menu is using on the Portfolio page to show only the "Assorted" category:&lt;br&gt;li class="segment-1"&amp;gt; a data-value="assorted" href="javascript:;"&amp;gt; Assorted /a /li&amp;gt; (had to remove some brackets to get it to display)&lt;/p&gt;

&lt;p&gt;I would be very grateful if anyone can help me out with this!&lt;/p&gt;

&lt;p&gt;PB&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">PB404</dc:creator><pubDate>Sun, 16 Oct 2011 20:38:01 -0000</pubDate></item><item><title>Re: How to inherit classes in javascript</title><link>http://www.javascriptkata.com/2007/05/22/how-to-inherit-classes-in-javascript/#comment-334712695</link><description>&lt;p&gt;I don't think you can do it.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">dsimard</dc:creator><pubDate>Fri, 14 Oct 2011 11:45:58 -0000</pubDate></item><item><title>Re: How to inherit classes in javascript</title><link>http://www.javascriptkata.com/2007/05/22/how-to-inherit-classes-in-javascript/#comment-334709043</link><description>&lt;p&gt;How do I inherit new Document() ?&lt;br&gt;Only get error.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Viktor Eriksson</dc:creator><pubDate>Fri, 14 Oct 2011 11:40:53 -0000</pubDate></item><item><title>Re: How to execute javascript code directly in your browser</title><link>http://www.javascriptkata.com/2007/05/01/execute-javascript-code-directly-in-your-browser/#comment-326723463</link><description>&lt;p&gt;&amp;lt;script&amp;gt;&lt;br&gt;document.getElementById('dsq-comments')=null;&lt;br&gt;&amp;lt;/script&amp;gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Farjad4g</dc:creator><pubDate>Tue, 04 Oct 2011 19:01:39 -0000</pubDate></item><item><title>Re: 3 reasons why I use jQuery</title><link>http://www.javascriptkata.com/2007/05/29/3-reasons-why-i-use-jquery/#comment-321386993</link><description>&lt;p&gt;Cool beans!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">David</dc:creator><pubDate>Tue, 27 Sep 2011 21:13:59 -0000</pubDate></item><item><title>Re: How to make sure undefined is not defined</title><link>http://www.javascriptkata.com/2011/09/13/how-to-make-sure-undefined-is-not-defined/#comment-311813712</link><description>&lt;p&gt;I don't know... maybe because it relies on a string. Maybe because of the &lt;em&gt;typeof&lt;/em&gt; operator that I don't like because I always write &lt;em&gt;typeOf&lt;/em&gt; instead. I just prefer other solutions...&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">dsimard</dc:creator><pubDate>Thu, 15 Sep 2011 09:38:28 -0000</pubDate></item><item><title>Re: How to make sure undefined is not defined</title><link>http://www.javascriptkata.com/2011/09/13/how-to-make-sure-undefined-is-not-defined/#comment-310789465</link><description>&lt;p&gt;Hey  dsimard, why do you consider it weak?&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">DracoBlue</dc:creator><pubDate>Thu, 15 Sep 2011 01:40:18 -0000</pubDate></item><item><title>Re: How to make sure undefined is not defined</title><link>http://www.javascriptkata.com/2011/09/13/how-to-make-sure-undefined-is-not-defined/#comment-308728847</link><description>&lt;p&gt;thanks for noticing it!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">dsimard</dc:creator><pubDate>Tue, 13 Sep 2011 13:10:00 -0000</pubDate></item><item><title>Re: How to make sure undefined is not defined</title><link>http://www.javascriptkata.com/2011/09/13/how-to-make-sure-undefined-is-not-defined/#comment-308727860</link><description>&lt;p&gt;Note that `null == void 0` evaluates to `true`.  Use `variable === void 0`.&lt;/p&gt;

&lt;p&gt;Not to put down your method, but I haven't seen `void 0` used at all in the wild outside of 'academic' examples, and I think it'd be harder to realize what `void 0` is *actually* doing (given its baggage in `javascript:` URI's).  `variable === undefined` and `typeof variable === 'undefined'` are the most common methods I see, and both work well.  (It's a matter of style, in other words, except for one minor case.)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">strager</dc:creator><pubDate>Tue, 13 Sep 2011 13:08:23 -0000</pubDate></item></channel></rss>
