<?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>Level 2D Blog &#187; Javascript</title>
	<atom:link href="http://level2b.com/category/programming/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://level2b.com</link>
	<description>(2.0)</description>
	<lastBuildDate>Tue, 10 Jan 2012 20:58:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Level 2 Has An Opening</title>
		<link>http://level2b.com/level-2-has-an-opening/</link>
		<comments>http://level2b.com/level-2-has-an-opening/#comments</comments>
		<pubDate>Sat, 27 Jun 2009 22:24:22 +0000</pubDate>
		<dc:creator>Nate Johnson</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Developer]]></category>
		<category><![CDATA[employment]]></category>
		<category><![CDATA[Jobs]]></category>
		<category><![CDATA[Level 2 Design]]></category>

		<guid isPermaLink="false">http://level2b.com/?p=140</guid>
		<description><![CDATA[Level 2 Design is looking for a web programmer.
The position will start out on a contract basis, with a goal of full time-employment.
 The job requirements are as follows: 
 Expertise: 
PHP/MySQL
HTML
CSS
Javascript (jQuery, Ajax, etc.)
 Familiar with: 
Flash Actionscript/Flex
PHP frameworks (Cake, CodeIgnitor, Zend, etc.)
ASP
Server maintenance
DNS configuration
The job includes building comprehensive websites with complex IA and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.level2d.com/">Level 2 Design</a> is looking for a web programmer.<br />
The position will start out on a contract basis, with a goal of full time-employment.</p>
<p><strong> The job requirements are as follows: </strong></p>
<p><strong> Expertise: </strong><br />
PHP/MySQL<br />
HTML<br />
CSS<br />
Javascript (jQuery, Ajax, etc.)</p>
<p><strong> Familiar with: </strong><br />
Flash Actionscript/Flex<br />
PHP frameworks (Cake, CodeIgnitor, Zend, etc.)<br />
ASP<br />
Server maintenance<br />
DNS configuration</p>
<p>The job includes building comprehensive websites with complex IA and various features for users. You will be working closely with a team of other developers, and designers to create the best possible products for clients.</p>
<p>If you are interested feel free to give us a call at 423.779.7172</p>
]]></content:encoded>
			<wfw:commentRss>http://level2b.com/level-2-has-an-opening/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript Options Object</title>
		<link>http://level2b.com/javascript-options-object/</link>
		<comments>http://level2b.com/javascript-options-object/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 17:32:18 +0000</pubDate>
		<dc:creator>Philip Brown</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Prototype Library]]></category>

		<guid isPermaLink="false">http://level2b.com/?p=3</guid>
		<description><![CDATA[I don&#8217;t know how many times in the past I have found myself using a class and I want to change only one of the optional parameters but it just so happens to be the last argument.&#160; In order to avoid changing the default value I have to look at the objects source code.&#160; There [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t know how many times in the past I have found myself using a class and I want to change only one of the optional parameters but it just so happens to be the last argument.&#160; In order to avoid changing the default value I have to look at the objects source code.&#160; There are two ways to avoid this issue.</p>
</p>
<p> <span id="more-3"></span>The first is to create setter functions for each option.&#160; I have several problems with this solution:
</p>
<ol>
<li>It requires time to create separate functions. </li>
<li>It requires more code and that means larger file size. </li>
<li>Creates more functions to document. </li>
<li>I like formatting my code so that I only have have one function on each line. </li>
<li>If I want to change three default options that means I will now have possibly 3 more lines of code. </li>
</ol>
<p>The second way is to have parameter that allows options to be passed as a JSON object. It uses default options that can be over written just by sending in a JSON object specifying only the settings you want to overwrite.</p>
<p><strong>Example:</strong></p>
<div class="csharpcode">
<pre><span class="lnum">   1:  </span>Menu = {</pre>
<pre><span class="lnum">   2:  </span>    initialize: <span class="kwrd">function</span>(button, menuElem, options)</pre>
<pre><span class="lnum">   3:  </span>    {</pre>
<pre><span class="lnum">   4:  </span>        <span class="kwrd">this</span>.button = (button);</pre>
<pre><span class="lnum">   5:  </span>        <span class="kwrd">this</span>.menuElem = (menuElem);</pre>
<pre><span class="lnum">   6:  </span>        <span class="kwrd">this</span>.setOptions(options);</pre>
<pre><span class="lnum">   7:  </span>    },</pre>
<pre><span class="lnum">   8:  </span>    setOptions(options)</pre>
<pre><span class="lnum">   9:  </span>    {</pre>
<pre><span class="lnum">  10:  </span>        <span class="kwrd">this</span>.options =    { align:<span class="str">'center'</span>, hide:<span class="kwrd">true</span>}</pre>
<pre><span class="lnum">  11:  </span>        <span class="rem">// extra {} prevents extending with null</span></pre>
<pre><span class="lnum">  12:  </span>        Object.extend(<span class="kwrd">this</span>.options, options || {});</pre>
<pre><span class="lnum">  13:  </span>    }</pre>
<pre><span class="lnum">  14:  </span>}</pre>
<pre><span class="lnum">  15:  </span>Woo = <span class="kwrd">new</span> Menu(<span class="str">'myButton'</span>, <span class="str">'myMenu'</span>, { hide: <span class="kwrd">false</span> });</pre>
</div>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>This way of doing things is not my idea.&#160; Not even close.&#160; jQuery uses it as do many others.&#160; The first place I saw it was two years ago in Rico JavaScript library.</p>
<p>So why am I revisiting this method of option handling? It is because my next post will cover how to port this brilliant methodology to PHP5.</p>
]]></content:encoded>
			<wfw:commentRss>http://level2b.com/javascript-options-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

