<?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>ThatGuyCharlie &#124; Charlie Mathews Blog &#38; Portfolio &#187; Javascript</title>
	<atom:link href="http://www.thatguycharlie.com/category/how-to/javascript-how-to/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thatguycharlie.com</link>
	<description>Charlie Mathews Blog &#38; Portfolio</description>
	<lastBuildDate>Fri, 28 Oct 2011 05:05:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How to Display Dymanicly Timed Content using Javascript</title>
		<link>http://www.thatguycharlie.com/2009/how-to-display-content-by-the-time-of-day/</link>
		<comments>http://www.thatguycharlie.com/2009/how-to-display-content-by-the-time-of-day/#comments</comments>
		<pubDate>Sat, 12 Dec 2009 23:11:34 +0000</pubDate>
		<dc:creator>Charlie</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[How to Display Dymanicly Timed Content with JavaScript]]></category>
		<category><![CDATA[time of day content]]></category>

		<guid isPermaLink="false">http://www.thatguycharlie.com/?p=821</guid>
		<description><![CDATA[I&#8217;ve spent many a long hour playing with this javascript to make it work seamlessly. You can see the results, daily, on my website. If you want to change your website background depending on the time of day you will need this specific code. Otherwise, make sure to read till the bottom so you understand [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve spent many a long hour playing with this javascript to make it work seamlessly. You can see the results, daily, on my website.</p>
<p>If you want to change your website background depending on the time of day you will need this specific code. Otherwise, make sure to read till the bottom so you understand and don&#8217;t come back to me asking why it isn&#8217;t working for you.</p>
<table border="0">
<tbody>
<tr>
<td>
<p>Nighttime on ThatGuyCharlie</p>
<p><img class="enhanimg" title="ThatGuyCharlie night-time background" src="http://www.thatguycharlie.com/wp-content/themes/scyhigh/img/night.png" alt="[image: TGCNight]" width="200" height="100" /></p>
</td>
<td>
<p>Daytime on ThatGuyCharlie</p>
<p><img class="enhanimg" title="ThatGuyCharlie Day-time Background" src="http://www.thatguycharlie.com/wp-content/themes/scyhigh/img/dayclouds.png" alt="[image: TGCDay]" width="200" height="100" /></p>
</td>
</tr>
</tbody>
</table>
<p><span id="more-821"></span>Copy this text into your webpage before the </head> tag.</p>
<p><span style="font-family: courier new,courier;"><script type="text/javascript"><br />
 <!--<br />
 now = new Date</span></p>
<p><span style="font-family: courier new,courier;">if (now.getHours() < 4) {<br />
 document.write("</p>
<style>html {background: #101318 url(\"http://www.thatguycharlie.com/wp-content/themes/scyhigh/img/night.png\") top center no-repeat;}</style>
<p>")<br />
 }<br />
 else if (now.getHours() < 10) {<br />
 document.write("</p>
<style>html {background: #101318 url(\"http://www.simpleshare.vividperfection.com/privateuploads/morningmountains.png\") top center no-repeat;}</style>
<p>")<br />
 }<br />
 else if (now.getHours() < 20) {<br />
 document.write("</p>
<style>html {background: #101318 url(\"http://www.thatguycharlie.com/wp-content/themes/scyhigh/img/dayclouds.png\") top center no-repeat;}</style>
<p>")<br />
 }<br />
 else if (now.getHours() < 24) {<br />
 document.write("</p>
<style>html {background: #101318 url(\"http://www.thatguycharlie.com/wp-content/themes/scyhigh/img/night.png\") top center no-repeat;}</style>
<p>")<br />
 }<br />
 //--><br />
 </script></span></p>
<p><strong>Ok now, if you didnt understand that, here&#8217;s what&#8217;s happening.</strong></p>
<p><br class="spacer_" /></p>
<p><span style="font-family: courier new,courier;">now = new Date</span></p>
<p><strong>Here we obtain the date from the user&#8217;s computer</strong></p>
<p><br class="spacer_" /></p>
<p><span style="font-family: courier new,courier;">if (now.getHours() < 4) {<br />
 document.write(&#8220;</p>
<style>html {background: #101318 url(\"http://www.thatguycharlie.com/wp-content/themes/scyhigh/img/night.png\") top center no-repeat;}</style>
<p>&#8220;)<br />
 }</span></p>
<p><strong>This bit of code says that if the hour of the day is before four o&#8217;clock AM, then print the css background style for night-time.</strong></p>
<p><br class="spacer_" /></p>
<p><span style="font-family: courier new,courier;">else if (now.getHours() < 10) {<br />
 document.write(&#8220;</p>
<style>html {background: #101318 url(\"http://www.simpleshare.vividperfection.com/privateuploads/morningmountains.png\") top center no-repeat;}</style>
<p>&#8220;)<br />
 }</span></p>
<p><strong>Again, this does the same, but checks to see if it is before 10 o&#8217;clock.</strong></p>
<p><br class="spacer_" /></p>
<p><span style="font-family: courier new,courier;">else if (now.getHours() < 24)</span></p>
<p><strong>Remember to have this last part of your code so the script knows what to do up till midnight. The first code which defines &#8220;< 4" will only display the specified content from zero o'clock until 4 o'clock so to display content till midnight, you must have "< 24".</strong></p>
<p><strong><br />
 </strong></p>
<p>You can use this code and copy in different content to display at any time of the day by changing the hours. If you didn&#8217;t understand any of that, don&#8217;t worry! Test out the code at the top on your web-page and see if you can make it work. If not, comment below and I will try to help you out.</p>
<p><br class="spacer_" /></p>
<p>If you want to display symbols like apostrophes &#8221; and backward slashes \ make sure to put a &#8220;\&#8221; before each one so that java-script recognizes it and dosen&#8217;t mess up your code.</p>
<p>Example of the WRONG way:</p>
<p>document.write(&#8220;hi! my friend said <span style="background-color: #ff0000;">&#8220;</span>I am going to the store<span style="background-color: #ff0000;"> </span><span style="background-color: #ff0000;">&#8220;</span>&#8220;);</p>
<p>Example of the RIGHT way:</p>
<p>document.write(&#8220;hi! my friend said <span style="background-color: #ff0000;">\&#8221;</span>I am going to the store<span style="background-color: #ff0000;">\&#8221;</span>&#8220;);</p>
<img src="http://www.thatguycharlie.com/?ak_action=api_record_view&id=821&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.thatguycharlie.com/2009/how-to-display-content-by-the-time-of-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To: JS Bookmark Script</title>
		<link>http://www.thatguycharlie.com/2009/how-to-js-bookmark-script/</link>
		<comments>http://www.thatguycharlie.com/2009/how-to-js-bookmark-script/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 20:25:09 +0000</pubDate>
		<dc:creator>Charlie</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.vividperfection.com/?p=714</guid>
		<description><![CDATA[This easy to implement Javascript bookmark script takes advantages of JS technology to provide functionality in most popular browsers like Internet Explorer and Firefox. Put this between the &#60;head&#62;&#60;/head&#62; tags of your webpage. &#60;script type=&#8221;text/javascript&#8221;&#62;&#60;!&#8211; function bookmarksite(title,url){ if (window.sidebar) window.sidebar.addPanel(title, url, &#8220;&#8221;); else if(window.opera &#38;&#38; window.print){ var elem = document.createElement(&#8216;a&#8217;); elem.setAttribute(&#8216;href&#8217;,url); elem.setAttribute(&#8216;title&#8217;,title); elem.setAttribute(&#8216;rel&#8217;,'sidebar&#8217;); elem.click(); } [...]]]></description>
			<content:encoded><![CDATA[<table border="0">
<tbody>
<tr>
<td>This easy to implement Javascript bookmark script takes advantages of JS technology to provide functionality in most popular browsers like Internet Explorer and Firefox.</td>
<td></td>
</tr>
<tr>
<td><strong>Put this between the &lt;head&gt;&lt;/head&gt; tags of your webpage.</strong></p>
<p><br class="spacer_" /></p>
<form> <textarea cols="40" rows="6" name="jsbkmark">&lt;script type=&#8221;text/javascript&#8221;&gt;&lt;!&#8211; function bookmarksite(title,url){ if (window.sidebar) 	window.sidebar.addPanel(title, url, &#8220;&#8221;); else if(window.opera &amp;&amp; window.print){ 	var elem = document.createElement(&#8216;a&#8217;); 	elem.setAttribute(&#8216;href&#8217;,url); 	elem.setAttribute(&#8216;title&#8217;,title); 	elem.setAttribute(&#8216;rel&#8217;,'sidebar&#8217;); 	elem.click(); }  else if(document.all) 	window.external.AddFavorite(url, title); } // &#8211;&gt;&lt;script&gt;</textarea></form>
<p><strong>Put this anywhere between the &lt;body&gt;&lt;/body&gt; tags. </strong></p>
<form> <textarea cols="40" rows="6" name="jsbkmark">&lt;a href=&#8221;javascript:bookmarksite(&#8216;A Cool JS Bookmark Code&#8217;, &#8216;http://vividperfection.com&#8217;)&#8221; mce_href=&#8221;javascript:bookmarksite(&#8216;A Cool JS Bookmark Code&#8217;, &#8216;http://vividperfection.com&#8217;)&#8221;&gt;Add This Code To Favorites&lt;/a&gt;</textarea></form>
<form> </form>
<form>&gt; <a href="http://www.simpleshare.vividperfection.com/uploads/js bookmkark code.html">Click HERE to download the script</a> &lt;<br />
 </form>
</td>
<td></td>
</tr>
</tbody>
</table>
<img src="http://www.thatguycharlie.com/?ak_action=api_record_view&id=714&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.thatguycharlie.com/2009/how-to-js-bookmark-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

