<?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>philnicholas.com &#187; Web Development</title>
	<atom:link href="http://www.philnicholas.com/category/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.philnicholas.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 15 Jul 2009 16:06:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Reloading your JavaScript without reloading your page</title>
		<link>http://www.philnicholas.com/2009/05/11/reloading-your-javascript-without-reloading-your-page/</link>
		<comments>http://www.philnicholas.com/2009/05/11/reloading-your-javascript-without-reloading-your-page/#comments</comments>
		<pubDate>Mon, 11 May 2009 08:23:01 +0000</pubDate>
		<dc:creator>Phil</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.philnicholas.com/?p=62</guid>
		<description><![CDATA[Maybe you&#8217;re like me and develop your JavaScript with an endless cycle of &#8220;edit&#8230; save&#8230; refresh&#8221; to see/test the results. This gets pretty tiring if you&#8217;re having to fill in a form or wait for a complicated page to load &#8230; <a href="http://www.philnicholas.com/2009/05/11/reloading-your-javascript-without-reloading-your-page/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Maybe you&#8217;re like me and develop your JavaScript with an endless cycle of &#8220;edit&#8230; save&#8230; refresh&#8221; to see/test the results. This gets pretty tiring if you&#8217;re having to fill in a form or wait for a complicated page to load up each time!Â  I thought, &#8220;Why can&#8217;t I just save the JavaScript and use it without having to reload the browser window? Can&#8217;t it just replace it in memory&#8230; live?&#8221;Â  Yes, it can.Â  Here&#8217;s how to do it.</p>
<p><span id="more-62"></span></p>
<p><strong>1. Build the loader function:</strong></p>
<p>Put the following code in the document &lt;head&gt;</p>
<p><code><span style="color: #800000;">&lt;script type=<span style="color: #0000ff;">"text/javascript"</span>&gt;</span><br />
<strong>function </strong>LoadMyJs(scriptName) {<br />
<strong><span style="color: #000080;">var </span></strong>docHeadObj = <span style="color: #800080;">document</span>.getElementsByTagName(<span style="color: #0000ff;">"head"</span>)[0];<br />
<strong><span style="color: #000080;">var </span></strong>dynamicScript = <span style="color: #800080;">document</span>.createElement(<span style="color: #0000ff;">"script"</span>);<br />
dynamicScript.type = <span style="color: #0000ff;">"text/javascript"</span>;<br />
dynamicScript.src = scriptName;<br />
docHeadObj.appendChild(newScript);<br />
}<br />
<span style="color: #800000;">&lt;/script&gt;</span></code></p>
<p><strong>2. Automatically call the loader once the page has loaded</strong></p>
<p><span style="color: #000080;"><code>&lt;body onLoad="<span style="color: #0000ff;">LoadMyJs()</span>"&gt;</code></span></p>
<p><strong>3. Place a button on the page to trigger the dynamic relead:</strong></p>
<p><span style="color: #ff9900;"><code>&lt;input type=<span style="color: #0000ff;">"button"</span> name=<span style="color: #0000ff;">"reloadjs"</span> value=<span style="color: #0000ff;">"Reload JavaScript"</span> onClick=<span style="color: #0000ff;">"LoadMyJs('</span></code></span><code><span style="color: #0000ff;">my_live_loading_script.js</span></code><span style="color: #ff9900;"><code><span style="color: #0000ff;">')"</span>&gt;</code></span></p>
<p>4. Load your page!</p>
<p>Now once your page is loaded it will called the <span style="color: #0000ff;">LoadMyJs() </span>method.Â  This method does the following:</p>
<ol>
<li>Defines a function called &#8220;LoadMyJs&#8221; that takes on parameter which we will herein refer to by the variable &#8220;scriptName&#8221;</li>
<li>Get the first (and only, of course) &#8220;head&#8221; tag as an object using the getElementsByTagName() method built into JavaScript.</li>
<li>Create a new variable called &#8220;<code>dynamicScript</code>&#8221; as a &#8220;script&#8221; (the funciton equivalent of having written a &lt;script&gt; tag).</li>
<li>Set the type to &#8220;text/javascript&#8221; (just the same as the <code><span style="color: #800000;">type=<span style="color: #0000ff;">"text/javascript"</span></span></code> in the &lt;script&gt; definition).</li>
<li>Tell the browser that the &#8220;source&#8221; (abbreviated &#8220;src&#8221;) of the JavaScript is whatever address was passed to the function when it was called (in this example, &#8220;<code><span style="color: #0000ff;">my_live_loading_script.js</span></code>&#8220;);</li>
<li>Take the now-defined &#8220;<code>dynamicScript</code>&#8221; ojbect and appended it to the document head.</li>
</ol>
<p>There you have it!Â  Whenever you make changes to your JavaScript file, just click the &#8220;Reload JavaScript&#8221; button on your page and the browser will reload the JavaScript <em>without </em>you having to reload the page and all that hassle.</p>
<p>From here you may want to get creative, just and loading multiple scripts or even using a couple functions to toggle between the effects of two different script (e.g., one that gives helpful info to newbies and another that gives more advanced help message).</p>
<p>Finally, a special thanks to Patrick Hunlock for his &#8220;<a title="How to Dynamically Insert Javascript And CSS" href="http://www.hunlock.com/blogs/Howto_Dynamically_Insert_Javascript_And_CSS">How to Dynamically Insert Javascript And CSS</a>&#8221; article that gave me the head start on this!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.philnicholas.com/2009/05/11/reloading-your-javascript-without-reloading-your-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MSO-BIDI meaning</title>
		<link>http://www.philnicholas.com/2009/01/30/mso-bidi-meaning/</link>
		<comments>http://www.philnicholas.com/2009/01/30/mso-bidi-meaning/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 20:41:24 +0000</pubDate>
		<dc:creator>Phil</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.philnicholas.com/?p=20</guid>
		<description><![CDATA[For those not familiar with working with Cascading Style Sheets for use by Microsoft Office product, some of the rules of the road can prove cryptic at best.Â  Case in point is the &#8221; series of embedded styles.Â  These can &#8230; <a href="http://www.philnicholas.com/2009/01/30/mso-bidi-meaning/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For those not familiar with working with Cascading Style Sheets for use by Microsoft Office product, some of the rules of the road can prove cryptic at best.Â  Case in point is the &#8221; series of embedded styles.Â  These can sometimes appear to conflict with other styles in the same declaration, for example:</p>
<pre>&lt;span style='font-size:11.0pt;mso-bidi-font-size:10.0pt;color:navy'&gt;</pre>
<p>The <a title="blocked::http://www.w3schools.com/CSS/pr_font_font-size.asp" href="http://www.w3schools.com/CSS/pr_font_font-size.asp">font-size</a> is a standard CSS declaration, but the next declaration is particular to Microsoft:</p>
<p>The &#8220;mso&#8221; part is, of course, the abbreviation for Microsoft Office (since Microsoft almost always abbreviates its name as &#8220;ms&#8221; in code). Â But what does &#8220;bidi&#8221; mean?Â  I hunted everywhere, but had to resort to deep Googling to dig up the answer from the <a title="blocked::http://blogs.msdn.com/ie/" href="http://blogs.msdn.com/ie/">Windows Internet Explorer Blog</a>. In a post dedicated to the issue of <a title="blocked::http://blogs.msdn.com/ie/archive/2006/02/15/532708.aspx" href="http://blogs.msdn.com/ie/archive/2006/02/15/532708.aspx">bidirectional text behavior in MSIE 6 vs. 7</a>, the IE gurus explain:</p>
<p style="padding-left: 30px;">When text is presented in horizontal lines, most scripts display characters from left to right. However, there are several languages (such as Arabic, Divehi, Hebrew and Syriac) where the natural ordering of horizontal text in display is right to left. Ambiguities can arise in determining the ordering of character display when text flows in two directions (hence Bidirectional) is present.</p>
<p>So the &#8220;bidi&#8221; means &#8220;bidirectional&#8221; and tells the Office-based application that declaration affects the display/print of bidirectional fonts, such as those for Arabic or Hebrew.</p>
<p>Therefore, the &#8220;mso-bidi-font-size:12.0pt&#8221; declaration means &#8220;Microsoft Office Bidirectional Font Size:12 point &#8221; style and allows the setting of a 12 point font size in the event of a bidirectional font appearing within the bounds of the declaration</p>
<p>Hopefully I just saved some of you a bit of Googling.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.philnicholas.com/2009/01/30/mso-bidi-meaning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Showcase of outstanding data representation at FlowingData.com</title>
		<link>http://www.philnicholas.com/2009/01/15/showcase-of-outstanding-data-representation-at-flowingdatacom/</link>
		<comments>http://www.philnicholas.com/2009/01/15/showcase-of-outstanding-data-representation-at-flowingdatacom/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 18:45:34 +0000</pubDate>
		<dc:creator>Phil</dc:creator>
				<category><![CDATA[Notable Web Dev Sites]]></category>

		<guid isPermaLink="false">http://www.philnicholas.com/?p=11</guid>
		<description><![CDATA[I can&#8217;t remember where I found it, but I ran across a fascinating time-based graphic depicting the growth of WalMart. Ever since taking the &#8220;Presenting Data and Information&#8221; course from the venerable Edward Tufte, I&#8217;ve been interested in information and &#8230; <a href="http://www.philnicholas.com/2009/01/15/showcase-of-outstanding-data-representation-at-flowingdatacom/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I can&#8217;t remember where I found it, but I ran across a fascinating <a href="http://projects.flowingdata.com/walmart/">time-based graphic depicting the growth of WalMart</a>.</p>
<p>Ever since taking the &#8220;<a href="http://www.edwardtufte.com/tufte/courses/">Presenting Data and Information</a>&#8221; course from the venerable <a href="http://www.edwardtufte.com/">Edward Tufte</a>, I&#8217;ve been interested  in information and statistics presentation (eventually contributing my minoring in visual communications). Representing numbers and data <em>visually </em>is very hard, especially when the goal of visual presentation (i.e., to demonstrate how the data relates to itself) often gets lost in our desire for glitzy over-production of whiz-bang PowerPoint.</p>
<p>So this brings us to the site <a title="FlowingData.com | Data Visualization and Statistics" href="http://flowingdata.com/">FlowingData.com</a>. Check it out, and don&#8217;t miss their <a title="5 Best Data Visualization Projects of the Year" href="http://flowingdata.com/2008/12/19/5-best-data-visualization-projects-of-the-year/">5 Best Data Visualization Projects of the Year</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.philnicholas.com/2009/01/15/showcase-of-outstanding-data-representation-at-flowingdatacom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
