<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>VV&#039;s Corner &#187; javascript</title>
	<atom:link href="http://vinoaj.com/blog/category/howtos/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://vinoaj.com/blog</link>
	<description>my collection of random thoughts, how-to&#039;s and code snippets</description>
	<lastBuildDate>Sat, 04 Dec 2010 15:05:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Triggering the Source Code view of the current page using JavaScript</title>
		<link>http://vinoaj.com/blog/2008/03/triggering-the-source-code-view-of-the-current-page-using-javascript/</link>
		<comments>http://vinoaj.com/blog/2008/03/triggering-the-source-code-view-of-the-current-page-using-javascript/#comments</comments>
		<pubDate>Fri, 28 Mar 2008 22:40:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://vinoaj.com/blog/uncategorized/triggering-the-source-code-view-of-the-current-page-using-javascript/</guid>
		<description><![CDATA[I was recently writing a demo to showcase the new Google Language API, and in my demo I did the usual thing of instructing users to View &#62; Page Source in order to view the source code and comments. I know this is less than ideal, because it forces users to have to process the [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently writing a <a href="http://vinoaj.com/google/language" title="Google Language API demo" target="_blank">demo to showcase the new Google Language API</a>, and in my demo I did the usual thing of instructing users to View &gt; Page Source in order to view the source code and comments.  I know this is less than ideal, because it forces users to have to process the instructions, and then execute them.  Somewhere in there you lose them and they never execute the desired action.</p>
<p>It got me thinking: is there a way to have the source code in front of them in one click?  A few Google searches later, and the answer was yes!</p>
<p>Using JavaScript you can open a new window to display the source code view of the current window:</p>
<div class="igBar"><span id="ljavascript-2"><a href="#" onclick="javascript:showPlainTxt('javascript-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
<div id="javascript-2">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">window.<span style="color: #000066;">open</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'view-source:'</span> + window.<span style="color: #006600;">location</span>.<span style="color: #006600;">href</span>, <span style="color: #3366CC;">'mysource'</span><span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Voila!  How easy was that?  Now it's your turn.</p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://vinoaj.com/blog/2008/03/triggering-the-source-code-view-of-the-current-page-using-javascript/&via=vinoaj&text=Triggering the Source Code view of the current page using JavaScript&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://vinoaj.com/blog/2008/03/triggering-the-source-code-view-of-the-current-page-using-javascript/&via=vinoaj&text=Triggering the Source Code view of the current page using JavaScript&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fvinoaj.com%2Fblog%2F2008%2F03%2Ftriggering-the-source-code-view-of-the-current-page-using-javascript%2F&amp;title=Triggering%20the%20Source%20Code%20view%20of%20the%20current%20page%20using%20JavaScript" id="wpa2a_2"><img src="http://vinoaj.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://vinoaj.com/blog/2008/03/triggering-the-source-code-view-of-the-current-page-using-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recommended Mozilla Firefox add-ons (aka extensions, aka plugins)</title>
		<link>http://vinoaj.com/blog/2007/07/recommended-mozilla-firefox-add-ons-aka-extensions-aka-plugins/</link>
		<comments>http://vinoaj.com/blog/2007/07/recommended-mozilla-firefox-add-ons-aka-extensions-aka-plugins/#comments</comments>
		<pubDate>Mon, 30 Jul 2007 02:15:19 +0000</pubDate>
		<dc:creator>vinoaj</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://vinoaj.com/blog/howtos/javascript/recommended-mozilla-firefox-add-ons-aka-extensions-aka-plugins/</guid>
		<description><![CDATA[This is a list of my "must-have" Mozilla Firefox add-ons. If you can recommend anything similar or better, be sure to drop me a comment. Page Analysis &#38; SEO Minimise Nuisance Bookmark Management Download Management Productivity Web Development &#38; Design Security Functional Extensions Tab Management Add-Ons Management Page Analysis &#38; SEO About This Site Bookmarks [...]]]></description>
			<content:encoded><![CDATA[<p>This is a list of my "must-have" <a href="https://addons.mozilla.org/en-US/firefox/" target="_blank">Mozilla Firefox add-ons</a>.  If you can recommend anything similar or better, be sure to drop me a comment.</p>
<hr />
<a href="#pageanalyis">Page Analysis &amp; SEO</a><br />
<a href="#nuisance">Minimise Nuisance</a><br />
<a href="#bookmarks">Bookmark Management</a><br />
<a href="#downloads">Download Management</a><br />
<a href="#productivity">Productivity</a><br />
<a href="#webdev">Web Development &amp; Design</a><br />
<a href="#security">Security</a><br />
<a href="#functional">Functional Extensions</a><br />
<a href="#tabs">Tab Management</a><br />
<a href="#addons">Add-Ons Management</a></p>
<hr /><a title="pageanalysis" name="pageanalysis"></a></p>
<h2>Page Analysis &amp; SEO</h2>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/3673" target="_blank"><strong>About This Site Bookmarks</strong></a> - right-click on a page, select "About This Site Bookmarks" and you will see a list of handy links pointing off to informational sites such as Alexa, Compete, Netcraft, del.icio.us, etc.</p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/321" target="_blank"><strong>SearchStatus</strong></a></p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/590" target="_blank"><strong>ShowIP</strong></a></p>
<hr />
<a title="nuisance" name="nuisance"></a></p>
<h2>Minimising Nuisance</h2>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/1865" target="_blank"><strong>Adblock Plus</strong></a></p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/1136" target="_blank"><strong>Adblock Filterset.G Updater</strong></a></p>
<hr />
<a title="bookmarks" name="bookmarks"></a></p>
<h2>Bookmark Management</h2>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/11" target="_blank"><strong>Add Bookmark Here</strong></a></p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/1553" target="_blank"><strong>Bookmark Duplicate Detector</strong></a></p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/3615" target="_blank"><strong>del.icio.us</strong></a></p>
<hr />
<a title="downloads" name="downloads"></a></p>
<h2>Download Management</h2>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/26" target="_blank"><strong>Download Statusbar</strong></a> - manage your downloads via the Firefox status bar.</p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/201" target="_blank"><strong>DownThemAll</strong></a> - conveniently download all link targets on a page.</p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/220" target="_blank"><strong>FlashGot</strong></a> - allows for single and multiple downloads utilising an external download manager of your choice (I prefer FlashGet).</p>
<hr />
<a title="productivity" name="productivity"></a></p>
<h2>Productivity</h2>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/383" target="_blank"><strong>Auto Copy</strong></a> - highlight a piece of text and the selection is automatically copied to your clipboard.</p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/1117" target="_blank"><strong>FoxClocks</strong></a> - displays local times around the world in the statusbar or toolbar.  Great for if you are dealing with friends and colleagues across multiple timezones.</p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/219" target="_blank"><strong>FoxyTunes</strong></a> - operate your currently running media player from your Firefox statusbar.</p>
<p><a href="http://www.google.com/notebook" target="_blank"><strong>Google Notebook</strong></a> - conveniently clip text and links to your Google Notebook.</p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/190" target="_blank"><strong>Linkification</strong></a> - Converts text links (including e-mail addresses) into clickable links.</p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/636" target="_blank"><strong>PDF Download</strong></a></p>
<hr />
<a title="webdev" name="webdev"></a></p>
<h2>Web Development &amp; Design</h2>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/271" target="_blank"><strong>ColorZilla</strong></a> - eye-dropper tool that allows you to pick the HEX &amp; RGB values of colours of elements on the page.</p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/1843" target="_blank"><strong>Firebug</strong></a> - the quintessential Javascript debugger.  It also allows for excellent DOM and CSS debugging and manipulation.</p>
<p><a href="https://addons.mozilla.org/en-US/firefox/images/addon_icon/249" target="_blank"><strong>HTML Validator</strong></a></p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/35" target="_blank"><strong>IE View</strong></a> - open the current page in an IE window.</p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/3829" target="_blank"><strong>Live HTTP Headers</strong></a> - view HTTP request and response headers in realtime.</p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/59" target="_blank"><strong>User Agent Switcher</strong></a> - allows you to spoof the User-Agent string and have Firefox masquerade as the Googlebot, etc, to see how your site reacts to different user-agents.</p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/655" target="_blank"><strong>View Source Chart</strong></a> - renders page source HTML in an easy-to-read manner.</p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/60" target="_blank"><strong>Web Developer</strong></a> - a must for the serious web developer.</p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/5369" target="_blank"><strong>YSlow</strong></a> - an addon to the Firebug debugger.  It allows you to profile a page and identify bottlenecks.  Provided by Yahoo.  Also see Yahoo's articles on improving page load performance.</p>
<hr />
<a title="security" name="security"></a></p>
<h2>Security</h2>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/2497" target="_blank"><strong>CookieSafe</strong></a></p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/4510" target="_blank"><strong>Edit Cookies</strong></a></p>
<p><a href="http://www.siteadvisor.com/download/ff.html" target="_blank"><strong>McAfee SiteAdvisor</strong></a> - lets you know if the currently viewed site is considered "safe" or not.</p>
<p><a title="functional" name="functional"></a></p>
<h2>Functionality Extensions</h2>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/743" target="_blank"><strong>CustomizeGoogle</strong></a> - customize your Google search and application experiences.</p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/3336" target="_blank"><strong>ErrorZilla</strong></a> - extends the standard page not found error screen with convenient links such as access to the page's Google cached copy.</p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/4429" target="_blank"><strong>Secure Login</strong></a></p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/315" target="_blank"><strong>View Cookies</strong></a></p>
<hr />
<a title="tabs" name="tabs"></a></p>
<h2>Tab Management</h2>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/3780" target="_blank"><strong>Faviconize Tab</strong></a> - minimize a tab's width to the width of the favicon.</p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/1122" target="_blank"><strong>Tab Mix Plus</strong></a></p>
<hr />
<a title="addons" name="addons"></a></p>
<h2>Add-Ons Management</h2>
<p><a href="http://www.google.com/tools/firefox/browsersync/" target="_blank"><strong>Google Browser Sync</strong></a></p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/2109" target="_blank"><strong>FEBE</strong></a> - a convenient extensions &amp; settings backup tool.  Allows you to also run scheduled backups.  The backups can be used to transport your extensions and their settings to another machine or Firefox profile.</p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/421" target="_blank"><strong>MR Tech Local Install</strong></a> - install power tools for add-ons</p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://vinoaj.com/blog/2007/07/recommended-mozilla-firefox-add-ons-aka-extensions-aka-plugins/&via=vinoaj&text=Recommended Mozilla Firefox add-ons (aka extensions, aka plugins)&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://vinoaj.com/blog/2007/07/recommended-mozilla-firefox-add-ons-aka-extensions-aka-plugins/&via=vinoaj&text=Recommended Mozilla Firefox add-ons (aka extensions, aka plugins)&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fvinoaj.com%2Fblog%2F2007%2F07%2Frecommended-mozilla-firefox-add-ons-aka-extensions-aka-plugins%2F&amp;title=Recommended%20Mozilla%20Firefox%20add-ons%20%28aka%20extensions%2C%20aka%20plugins%29" id="wpa2a_4"><img src="http://vinoaj.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://vinoaj.com/blog/2007/07/recommended-mozilla-firefox-add-ons-aka-extensions-aka-plugins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Class Inheritance in Javascript</title>
		<link>http://vinoaj.com/blog/2007/06/class-inheritance-in-javascript/</link>
		<comments>http://vinoaj.com/blog/2007/06/class-inheritance-in-javascript/#comments</comments>
		<pubDate>Tue, 05 Jun 2007 11:07:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[howto]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[oo]]></category>

		<guid isPermaLink="false">http://vinoaj.com/blog/howtos/class-inheritance-in-javascript/</guid>
		<description><![CDATA[My previous post showed how to create classes in Javascript. This addendum post shows how to create an inherited class from a parent class. The concept is simple. Declare and define your parent class Declare and define your child class without defining the parent-child relationship Add a new instance of your parent class to your [...]]]></description>
			<content:encoded><![CDATA[<p>My previous post <a href="http://vinoaj.com/blog/howtos/creating-classes-with-javascript/">showed how to create classes in Javascript</a>.  This addendum post shows how to create an inherited class from a parent class.</p>
<p>The concept is simple.</p>
<ol>
<li>Declare and define your parent class</li>
<li>Declare and define your child class <strong>without</strong> defining the parent-child relationship</li>
<li>Add a new instance of your parent class to your child class' prototype.  Now the child class has access to the parent class' properties and methods.  This last step may seem counter-intuitive, but the example below helps to clarify what I mean.</li>
</ol>
<div class="igBar"><span id="ljavascript-5"><a href="#" onclick="javascript:showPlainTxt('javascript-5'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
<div id="javascript-5">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> SuperHero<span style="color: #66cc66;">&#40;</span>heroID, p1, p2, p3<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; ...</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; ...</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; ...</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">/* Do some extending of SuperHero's prototype here */</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">//Now let's define our child class - note that we do not initially define the parent-child relationship</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> AlienSuperHero<span style="color: #66cc66;">&#40;</span>heroID, homePlanet, race, p1, p2, p3<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; ...</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//Now we indicate the parent-child relationship</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">prototype</span> = <span style="color: #003366; font-weight: bold;">new</span> SuperHero<span style="color: #66cc66;">&#40;</span>heroID, p1, p2, p3<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">/* Do some extending of AlienSuperHero's prototype here */</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Usage would be along the lines of:</p>
<div class="igBar"><span id="ljavascript-6"><a href="#" onclick="javascript:showPlainTxt('javascript-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
<div id="javascript-6">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> MartianManhunter = <span style="color: #003366; font-weight: bold;">new</span> AlienSuperHero<span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;color:#800000;">3454</span>, <span style="color: #3366CC;">'Mars'</span>, <span style="color: #3366CC;">'Martian'</span>, <span style="color: #3366CC;">'Flight'</span>, <span style="color: #3366CC;">'Telepathy'</span>, <span style="color: #3366CC;">'Shapeshifting'</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>fire<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//This is a method defined in the parent class</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; MartianManhunter.<span style="color: #006600;">losePowers</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://vinoaj.com/blog/2007/06/class-inheritance-in-javascript/&via=vinoaj&text=Class Inheritance in Javascript&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://vinoaj.com/blog/2007/06/class-inheritance-in-javascript/&via=vinoaj&text=Class Inheritance in Javascript&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fvinoaj.com%2Fblog%2F2007%2F06%2Fclass-inheritance-in-javascript%2F&amp;title=Class%20Inheritance%20in%20Javascript" id="wpa2a_6"><img src="http://vinoaj.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://vinoaj.com/blog/2007/06/class-inheritance-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating classes with Javascript</title>
		<link>http://vinoaj.com/blog/2007/06/creating-classes-with-javascript/</link>
		<comments>http://vinoaj.com/blog/2007/06/creating-classes-with-javascript/#comments</comments>
		<pubDate>Tue, 05 Jun 2007 10:51:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[howto]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[oo]]></category>

		<guid isPermaLink="false">http://vinoaj.com/blog/howtos/creating-classes-with-javascript/</guid>
		<description><![CDATA[Javascript is a prototype-based language rather than a class-based language (e.g. Java). For an explanation of the difference, see Mozilla's comparison of class-based and prototype-based languages. In short, in a class-based language, objects are created by instantiating classes. The classes' list of properties and methods cannot be altered (e.g. added to) at runtime. A prototype-based [...]]]></description>
			<content:encoded><![CDATA[<p>Javascript is a prototype-based language rather than a class-based language (e.g. Java).  For an explanation of the difference, see Mozilla's <a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:Class-Based_vs._Prototype-Based_Languages" target="_blank">comparison of class-based and prototype-based languages</a>.  </p>
<p>In short, in a class-based language, objects are created by instantiating classes.  The classes' list of properties and methods cannot be altered (e.g. added to) at runtime.  A prototype-based language does not have the notion of a class.  Everything is an object.  A prototype-based object can have its list of properties and methods modified during runtime.</p>
<p>The examples below show how to create a class in Javascript.  First we define a function that will behave as our constructor.  Then we extend that function's prototype to include further functions that will behave as the class' methods.  Note the use of the &quot;this&quot; keyword to refer to the prototype of the current object.</p>
<div class="igBar"><span id="ljavascript-9"><a href="#" onclick="javascript:showPlainTxt('javascript-9'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
<div id="javascript-9">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">//This is our constructor</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> SuperHero<span style="color: #66cc66;">&#40;</span>heroID, p1, p2, p3<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">heroID</span> = heroID;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #000066;">name</span> = <span style="color: #003366; font-weight: bold;">null</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">power_1</span> = p1;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">power_2</span> = p2;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">power_3</span> = p3;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">power_ultimate</span> = p1 + p2 + p3;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">//Now add some methods to the class</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">SuperHero.<span style="color: #006600;">prototype</span>.<span style="color: #006600;">getPower1</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">power_1</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">SuperHero.<span style="color: #006600;">prototype</span>.<span style="color: #006600;">losePowers</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">power_1</span> = <span style="color: #003366; font-weight: bold;">null</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">power_2</span> = <span style="color: #003366; font-weight: bold;">null</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">power_3</span> = <span style="color: #003366; font-weight: bold;">null</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">SuperHero.<span style="color: #006600;">prototype</span>.<span style="color: #006600;">setName</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066;">name</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #000066;">name</span> = <span style="color: #000066;">name</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">SuperHero.<span style="color: #006600;">prototype</span>.<span style="color: #006600;">alertProfile</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> str = <span style="color: #3366CC;">'Hero Profile:<span style="color: #000099; font-weight: bold;">\n</span>'</span> +</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #3366CC;">'Name: '</span> + <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #000066;">name</span> + <span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span> +</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #3366CC;">'Name: '</span> + <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #000066;">name</span> + <span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span> +</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #3366CC;">'Name: '</span> + <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #000066;">name</span> + <span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span> +</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #3366CC;">'Name: '</span> + <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #000066;">name</span> + <span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span> +</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>And now we have a simple class with a few simple properties and methods.  Usage of the class would be something like:</p>
<div class="igBar"><span id="ljavascript-10"><a href="#" onclick="javascript:showPlainTxt('javascript-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
<div id="javascript-10">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> Superman = <span style="color: #003366; font-weight: bold;">new</span> SuperHero<span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;color:#800000;">2331</span>, <span style="color: #3366CC;">'Flight'</span>, <span style="color: #3366CC;">'Speed'</span>, <span style="color: #3366CC;">'Strength'</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Superman.<span style="color: #006600;">setName</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'Superman: Man of Steel'</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> power_1&nbsp; = Superman.<span style="color: #006600;">getPower1</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>kryptonite<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; Superman.<span style="color: #006600;">losePowers</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Superman.<span style="color: #006600;">alertProfile</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://vinoaj.com/blog/2007/06/creating-classes-with-javascript/&via=vinoaj&text=Creating classes with Javascript&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://vinoaj.com/blog/2007/06/creating-classes-with-javascript/&via=vinoaj&text=Creating classes with Javascript&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fvinoaj.com%2Fblog%2F2007%2F06%2Fcreating-classes-with-javascript%2F&amp;title=Creating%20classes%20with%20Javascript" id="wpa2a_8"><img src="http://vinoaj.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://vinoaj.com/blog/2007/06/creating-classes-with-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add list items to a list via the DOM</title>
		<link>http://vinoaj.com/blog/2007/04/add-list-items-to-a-list-via-the-dom/</link>
		<comments>http://vinoaj.com/blog/2007/04/add-list-items-to-a-list-via-the-dom/#comments</comments>
		<pubDate>Thu, 05 Apr 2007 05:38:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[DOM]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://vinoaj.com/blog/howtos/javascript/dom/add-list-items-to-a-list-via-the-dom/</guid>
		<description><![CDATA[PLAIN TEXT JavaScript: //Create new list element var new_item&#160; &#160; &#160; &#160; &#160;= document.createElement&#40;'li'&#41;; var new_item_label = document.createTextNode&#40;title&#41;; new_item.appendChild&#40;new_item_label&#41;; new_item.id = '467894sfs6f579f4sa6'; &#160; parent_container.appendChild&#40;new_item&#41;; TweetTweet]]></description>
			<content:encoded><![CDATA[<div class="igBar"><span id="ljavascript-12"><a href="#" onclick="javascript:showPlainTxt('javascript-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JavaScript:</span>
<div id="javascript-12">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">//Create new list element</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> new_item&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= document.<span style="color: #006600;">createElement</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'li'</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> new_item_label = document.<span style="color: #006600;">createTextNode</span><span style="color: #66cc66;">&#40;</span>title<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">new_item.<span style="color: #006600;">appendChild</span><span style="color: #66cc66;">&#40;</span>new_item_label<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">new_item.<span style="color: #006600;">id</span> = <span style="color: #3366CC;">'467894sfs6f579f4sa6'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">parent_container.<span style="color: #006600;">appendChild</span><span style="color: #66cc66;">&#40;</span>new_item<span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://vinoaj.com/blog/2007/04/add-list-items-to-a-list-via-the-dom/&via=vinoaj&text=Add list items to a list via the DOM&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://vinoaj.com/blog/2007/04/add-list-items-to-a-list-via-the-dom/&via=vinoaj&text=Add list items to a list via the DOM&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fvinoaj.com%2Fblog%2F2007%2F04%2Fadd-list-items-to-a-list-via-the-dom%2F&amp;title=Add%20list%20items%20to%20a%20list%20via%20the%20DOM" id="wpa2a_10"><img src="http://vinoaj.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://vinoaj.com/blog/2007/04/add-list-items-to-a-list-via-the-dom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

