<?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>Josh Stauffer&#187; JavaScript</title>
	<atom:link href="http://www.joshstauffer.com/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.joshstauffer.com</link>
	<description>WordPress, Genesis, &#38; Things I Care About</description>
	<lastBuildDate>Sun, 11 Dec 2011 01:08:20 +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>JavaScript: 3 Ways to Use document.write</title>
		<link>http://www.joshstauffer.com/ways-to-use-document-write/</link>
		<comments>http://www.joshstauffer.com/ways-to-use-document-write/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 14:58:06 +0000</pubDate>
		<dc:creator>Josh Stauffer</dc:creator>
				<category><![CDATA[Snippets]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.joshstauffer.com/?p=253</guid>
		<description><![CDATA[The document.write command is a standard, yet powerful, JavaScript command for writing output to a page. In this article I&#8217;ve outline 3 ways to use document.write statements. Example 1 &#60;script type="text/javascript"&#62; document.write('&#60;div&#62;'); document.write(' &#60;h4&#62;Example 1 using document.write&#60;/h4&#62;'); document.write(' &#60;p&#62;This example uses multiple document.write commands to write ouput to a page.&#60;/p&#62;'); document.write('&#60;/div&#62;'); &#60;/script&#62; Example 2 &#60;script [...]


Related posts:<ol><li><a href='http://www.joshstauffer.com/track-404s-with-google-analytics/' rel='bookmark' title='Permanent Link: Simple Way to Track 404 Error Pages with Google Analytics'>Simple Way to Track 404 Error Pages with Google Analytics</a></li>
<li><a href='http://www.joshstauffer.com/how-to-install-google-analytics-on-wordpress/' rel='bookmark' title='Permanent Link: How to Install Google Analytics on WordPress'>How to Install Google Analytics on WordPress</a></li>
<li><a href='http://www.joshstauffer.com/neat-pop-up-windows-for-images/' rel='bookmark' title='Permanent Link: Neat Pop-up Windows for Images'>Neat Pop-up Windows for Images</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.joshstauffer.com%2Fways-to-use-document-write%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.joshstauffer.com%2Fways-to-use-document-write%2F&amp;source=joshstauffer&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>The <strong><a class="track" rel="nofollow" href="http://www.w3schools.com/JS/js_howto.asp" target="_blank">document.write</a></strong> command is a standard, yet powerful, JavaScript command for writing output to a page. In this article I&#8217;ve outline 3 ways to use document.write statements.</p>
<p><span id="more-253"></span></p>
<h3>Example 1</h3>
<pre><code>&lt;script type="text/javascript"&gt;
document.write('&lt;div&gt;');
document.write('	&lt;h4&gt;Example 1 using document.write&lt;/h4&gt;');
document.write('	&lt;p&gt;This example uses multiple document.write commands to write ouput to a page.&lt;/p&gt;');
document.write('&lt;/div&gt;');
&lt;/script&gt;</code></pre>
<h3>Example 2</h3>
<pre><code>&lt;script type="text/javascript"&gt;
var output = '';
output  = '&lt;div&gt;';
output  = '	&lt;h4&gt;Example 2 using document.write&lt;/h4&gt;';
output  = '	&lt;p&gt;This example uses a lengthy string and a single document.write command to write ouput to a page.&lt;/p&gt;';
output  = '&lt;/div&gt;';
document.write(output);
&lt;/script&gt;</code></pre>
<h3>Example 3</h3>
<pre><code>&lt;script type="text/javascript"&gt;
var output = [
'&lt;div&gt;',
'	&lt;h4&gt;Example 3 using document.write&lt;/h4&gt;',
'	&lt;p&gt;This example uses an array and a single document.write command to write output to a page.&lt;/p&gt;',
'&lt;/div&gt;'
];
document.write(output.join('\n'));
&lt;/script&gt;</code></pre>
<p><strong><a rel="nofollow" href="http://www.joshstauffer.com/demos/using-document-write/" target="_blank">View live demonstration</a></strong> with all 3 examples.</p>


<p>Related posts:<ol><li><a href='http://www.joshstauffer.com/track-404s-with-google-analytics/' rel='bookmark' title='Permanent Link: Simple Way to Track 404 Error Pages with Google Analytics'>Simple Way to Track 404 Error Pages with Google Analytics</a></li>
<li><a href='http://www.joshstauffer.com/how-to-install-google-analytics-on-wordpress/' rel='bookmark' title='Permanent Link: How to Install Google Analytics on WordPress'>How to Install Google Analytics on WordPress</a></li>
<li><a href='http://www.joshstauffer.com/neat-pop-up-windows-for-images/' rel='bookmark' title='Permanent Link: Neat Pop-up Windows for Images'>Neat Pop-up Windows for Images</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.joshstauffer.com/ways-to-use-document-write/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Neat Pop-up Windows for Images</title>
		<link>http://www.joshstauffer.com/neat-pop-up-windows-for-images/</link>
		<comments>http://www.joshstauffer.com/neat-pop-up-windows-for-images/#comments</comments>
		<pubDate>Sun, 13 May 2007 23:41:34 +0000</pubDate>
		<dc:creator>Josh Stauffer</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.joshstauffer.com/2007/05/13/neat-pop-up-windows-for-images/</guid>
		<description><![CDATA[I have often considered myself to be a perfectionist since I spend much of my time fixing unnoticeable imperfections. Until recently I was using the javascript function window.open for some of my pop up images and had to guess at what the height and width arguments should be so that no white would show in [...]


Related posts:<ol><li><a href='http://www.joshstauffer.com/open-links-in-new-windows/' rel='bookmark' title='Permanent Link: Open Links in New Windows'>Open Links in New Windows</a></li>
<li><a href='http://www.joshstauffer.com/cool-digital-camera-trick/' rel='bookmark' title='Permanent Link: Cool Digital Camera Trick'>Cool Digital Camera Trick</a></li>
<li><a href='http://www.joshstauffer.com/search-in-file-contents-in-windows/' rel='bookmark' title='Permanent Link: Search in File Contents in Windows'>Search in File Contents in Windows</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.joshstauffer.com%2Fneat-pop-up-windows-for-images%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.joshstauffer.com%2Fneat-pop-up-windows-for-images%2F&amp;source=joshstauffer&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><script src="http://www.joshstauffer.com/wp-content/uploads/mosthumb.js" type="text/javascript"></script>I have often considered myself to be a perfectionist since I spend much of my time fixing unnoticeable imperfections. Until recently I was using the javascript function window.open for some of my pop up images and had to guess at what the height and width arguments should be so that no white would show in the pop-up window. This quickly became very aggravating as I was adjusting these values by a few pixels each time then checking to see how it looked in IE6 and FireFox. Then I started using the window.resize function which automatically resizes the window after it has loaded to what ever values you specify. Well I have given up on those methods and I will share with you how you can too.</p>
<p>I swiped a javascript file one day while surfing the web and I use this script to create neat pop-up windows for images.</p>
<p>Place the code below into the head section of your page.</p>
<pre style="border: 1px dotted #8080ff; padding: 2px; background: #ccccff none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial">
&lt;script type="text/javascript" src="mosthumb.js"&gt;&lt;/script&gt;</pre>
<p>Then, use the following code in the body section to contruct your thumbnail links.</p>
<pre style="border: 1px dotted #8080ff; padding: 2px; background: #ccccff none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial">
&lt;a href="javascript:thumbWindow('YourLargeImageHere',
'Pop-up Windows Title Goes Here',600,400,0,1);"&gt;
&lt;img src="YourSmallImageHere" width="150"
height="100" alt="Picture Description" border="0" /&gt;
&lt;/a&gt;</pre>
<p>Click on the thumbnail below for an example of this script in action.</p>
<p><a href="javascript:thumbWindow('http://www.joshstauffer.com/wp-content/uploads/popupimage-lg.jpg','More Notes For You',700,521,0,1);"><img src="http://www.joshstauffer.com/wp-content/uploads/popupimage-sm.jpg" alt="Thumbnail" border="0" height="100" width="134" /></a></p>
<p>Please note, I have slightly modified the original javascript file but do not take any credit for the creation of this script. You can download the javascript file <a href="http://www.joshstauffer.com/wp-content/uploads/mosthumb.js" title="Right Click &amp; 'Save Target As' in IE or 'Save Link As' in FireFox" target="_blank">here</a>.</p>


<p>Related posts:<ol><li><a href='http://www.joshstauffer.com/open-links-in-new-windows/' rel='bookmark' title='Permanent Link: Open Links in New Windows'>Open Links in New Windows</a></li>
<li><a href='http://www.joshstauffer.com/cool-digital-camera-trick/' rel='bookmark' title='Permanent Link: Cool Digital Camera Trick'>Cool Digital Camera Trick</a></li>
<li><a href='http://www.joshstauffer.com/search-in-file-contents-in-windows/' rel='bookmark' title='Permanent Link: Search in File Contents in Windows'>Search in File Contents in Windows</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.joshstauffer.com/neat-pop-up-windows-for-images/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

