<?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>Gray Matter Blog &#187; JavaScript</title>
	<atom:link href="http://www.henriemedia.com/blog/view/code-library/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.henriemedia.com/blog</link>
	<description>The faculty of intelligence and reason.</description>
	<lastBuildDate>Thu, 05 Aug 2010 16:27:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Use multiple lines with document.write()</title>
		<link>http://www.henriemedia.com/blog/code-library/javascript/use-multiple-lines-with-document-write/</link>
		<comments>http://www.henriemedia.com/blog/code-library/javascript/use-multiple-lines-with-document-write/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 14:45:45 +0000</pubDate>
		<dc:creator>Henrie Media Inc.</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.henriemedia.com/blog/?p=594</guid>
		<description><![CDATA[I often get the question if it&#8217;s possible to use document.write() in JavaScript to output multiple likes instread of having to put &#8211; document.write(&#8216; &#8211; at the beginning of every line and &#8211; &#8216;); &#8211; at the end. The answer is Yes. Here is how - document.write( &#8216;line1&#8242; +&#8217;line2&#8242; +&#8217;line3&#8242; ) OR - document.write( &#8216;line1&#8242; [...]]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-346" href="http://www.henriemedia.com/blog/code-library/javascript-timer/attachment/computer-icon/"><img class="alignright size-full wp-image-346" title="Computer" src="http://www.henriemedia.com/blog/wp-content/uploads/computer-icon.jpg" alt="" width="150" height="130" /></a>I often get the question if it&#8217;s possible to use document.write() in JavaScript to output multiple likes instread of having to put &#8211; document.write(&#8216; &#8211; at the beginning of every line and &#8211; &#8216;); &#8211; at the end. The answer is Yes. Here is how -</p>
<blockquote><p>document.write(<br />
&#8216;line1&#8242;<br />
+&#8217;line2&#8242;<br />
+&#8217;line3&#8242;<br />
)</p>
<p>OR -</p>
<p>document.write(<br />
&#8216;line1&#8242; + &#8216;\n&#8217;<br />
+&#8217;line2&#8242; + &#8216;\n&#8217;<br />
+&#8217;line3&#8242; + &#8216;\n&#8217;<br />
)</p>
<p>..or use a single string -</p>
<p>document.write(<br />
&#8216;line1\<br />
line2\<br />
line3&#8242;<br />
)</p></blockquote>
<p>JavaScript is a little funny, so make sure you test! Hope this helps!</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Print, Email, Share, Enjoy!</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript%2Fuse-multiple-lines-with-document-write%2F&amp;partner=sociable" title="Print"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="mailto:?subject=Use%20multiple%20lines%20with%20document.write%28%29&amp;body=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript%2Fuse-multiple-lines-with-document-write%2F" title="email"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Use%20multiple%20lines%20with%20document.write%28%29%20-%20http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript%2Fuse-multiple-lines-with-document-write%2F" title="Twitter"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript%2Fuse-multiple-lines-with-document-write%2F&amp;t=Use%20multiple%20lines%20with%20document.write%28%29" title="Facebook"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript%2Fuse-multiple-lines-with-document-write%2F&amp;title=Use%20multiple%20lines%20with%20document.write%28%29&amp;bodytext=I%20often%20get%20the%20question%20if%20it%27s%20possible%20to%20use%20document.write%28%29%20in%20JavaScript%20to%20output%20multiple%20likes%20instread%20of%20having%20to%20put%20-%20document.write%28%27%20-%20at%20the%20beginning%20of%20every%20line%20and%20-%20%27%29%3B%20-%20at%20the%20end.%20The%20answer%20is%20Yes.%20Here%20is%20how%20-%0D%0Adocument." title="Digg"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript%2Fuse-multiple-lines-with-document-write%2F&amp;t=Use%20multiple%20lines%20with%20document.write%28%29" title="MySpace"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript%2Fuse-multiple-lines-with-document-write%2F&amp;title=Use%20multiple%20lines%20with%20document.write%28%29" title="Mixx"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript%2Fuse-multiple-lines-with-document-write%2F&amp;title=Use%20multiple%20lines%20with%20document.write%28%29&amp;notes=I%20often%20get%20the%20question%20if%20it%27s%20possible%20to%20use%20document.write%28%29%20in%20JavaScript%20to%20output%20multiple%20likes%20instread%20of%20having%20to%20put%20-%20document.write%28%27%20-%20at%20the%20beginning%20of%20every%20line%20and%20-%20%27%29%3B%20-%20at%20the%20end.%20The%20answer%20is%20Yes.%20Here%20is%20how%20-%0D%0Adocument." title="del.icio.us"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript%2Fuse-multiple-lines-with-document-write%2F" title="Technorati"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript%2Fuse-multiple-lines-with-document-write%2F&amp;title=Use%20multiple%20lines%20with%20document.write%28%29" title="StumbleUpon"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.henriemedia.com/blog/code-library/javascript/use-multiple-lines-with-document-write/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Random numbers in JavaScript</title>
		<link>http://www.henriemedia.com/blog/code-library/javascript/random-numbers/</link>
		<comments>http://www.henriemedia.com/blog/code-library/javascript/random-numbers/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 14:39:36 +0000</pubDate>
		<dc:creator>Henrie Media Inc.</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.henriemedia.com/blog/?p=386</guid>
		<description><![CDATA[I am often asked the question of how to generate random numbers in JavaScript. It&#8217;s a little tricky and the results may be unpredictable, but the technique to getting them certainly is not. To generate a random number in JavaScript, simply use the following code: var randomnumber=Math.floor(Math.random()*11) where 11 dictates that the random number will [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-346" title="Computer" src="http://www.henriemedia.com/blog/wp-content/uploads/computer-icon.jpg" alt="Computer" width="150" height="130" />I am often asked the question of how to generate random numbers in JavaScript. It&#8217;s a little tricky and the results may be unpredictable, but the technique to getting them      certainly is not. To generate a random number in JavaScript, simply use the      following code:</p>
<div>
<pre>var randomnumber=Math.floor(Math.random()*11)</pre>
</div>
<p>where 11 dictates that the random number will fall between 0-10. To increase      the range to, say, 100, simply change 11 to 101 instead.</p>
<p>Some of you may be curious as to why Math.floor(), instead of Math.round(),      is used in the above code. While both successfully round off its containing      parameter to an integer within the designated range, Math.floor does so more      &#8220;evenly&#8221;, so the resulting integer isn&#8217;t lopsided towards either end of the      number spectrum. In other words, a more random number is returned using      Math.floor().</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Print, Email, Share, Enjoy!</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript%2Frandom-numbers%2F&amp;partner=sociable" title="Print"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="mailto:?subject=Random%20numbers%20in%20JavaScript&amp;body=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript%2Frandom-numbers%2F" title="email"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Random%20numbers%20in%20JavaScript%20-%20http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript%2Frandom-numbers%2F" title="Twitter"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript%2Frandom-numbers%2F&amp;t=Random%20numbers%20in%20JavaScript" title="Facebook"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript%2Frandom-numbers%2F&amp;title=Random%20numbers%20in%20JavaScript&amp;bodytext=I%20am%20often%20asked%20the%20question%20of%20how%20to%20generate%20random%20numbers%20in%20JavaScript.%20It%27s%20a%20little%20tricky%20and%20the%20results%20may%20be%20unpredictable%2C%20but%20the%20technique%20to%20getting%20them%20%20%20%20%20%20certainly%20is%20not.%20To%20generate%20a%20random%20number%20in%20JavaScript%2C%20simply%20use%20t" title="Digg"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript%2Frandom-numbers%2F&amp;t=Random%20numbers%20in%20JavaScript" title="MySpace"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript%2Frandom-numbers%2F&amp;title=Random%20numbers%20in%20JavaScript" title="Mixx"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript%2Frandom-numbers%2F&amp;title=Random%20numbers%20in%20JavaScript&amp;notes=I%20am%20often%20asked%20the%20question%20of%20how%20to%20generate%20random%20numbers%20in%20JavaScript.%20It%27s%20a%20little%20tricky%20and%20the%20results%20may%20be%20unpredictable%2C%20but%20the%20technique%20to%20getting%20them%20%20%20%20%20%20certainly%20is%20not.%20To%20generate%20a%20random%20number%20in%20JavaScript%2C%20simply%20use%20t" title="del.icio.us"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript%2Frandom-numbers%2F" title="Technorati"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript%2Frandom-numbers%2F&amp;title=Random%20numbers%20in%20JavaScript" title="StumbleUpon"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.henriemedia.com/blog/code-library/javascript/random-numbers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript Timer</title>
		<link>http://www.henriemedia.com/blog/code-library/javascript-timer/</link>
		<comments>http://www.henriemedia.com/blog/code-library/javascript-timer/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 21:24:18 +0000</pubDate>
		<dc:creator>Henrie Media Inc.</dc:creator>
				<category><![CDATA[Code Library]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.henriemedia.com/?p=270</guid>
		<description><![CDATA[Sometimes you need to perform a function after a set time has passed. This script is a simple to use JavaScript timer. Here&#8217;s the script: &#60;SCRIPT LANGUAGE = "JavaScript"&#62; &#60;!-- var secs var timerID = null var timerRunning = false var delay = 1000 function InitializeTimer() { // Set the length of the timer, in [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-346" title="Computer" src="http://www.henriemedia.com/blog/wp-content/uploads/computer-icon.jpg" alt="Computer" width="150" height="130" />Sometimes you need to perform a function after a set time has passed. This script is a simple to use JavaScript timer.</p>
<p>Here&#8217;s the script:</p>
<pre>&lt;SCRIPT LANGUAGE = "JavaScript"&gt;
&lt;!--
var secs
var timerID = null
var timerRunning = false
var delay = 1000

function InitializeTimer()
{
    // Set the length of the timer, in seconds
    secs = 10
    StopTheClock()
    StartTheTimer()
}

function StopTheClock()
{
    if(timerRunning)
        clearTimeout(timerID)
    timerRunning = false
}

function StartTheTimer()
{
    if (secs==0)
    {
        StopTheClock()
        // Here's where you put something useful that's
        // supposed to happen after the allotted time.
        // For example, you could display a message:
        alert("You have just wasted 10 seconds of your life.")
    }
    else
    {
        self.status = secs
        secs = secs - 1
        timerRunning = true
        timerID = self.setTimeout("StartTheTimer()", delay)
    }
}
//--&gt;
&lt;/SCRIPT&gt;</pre>
<p>To use this script, copy everything between and including the &lt;SCRIPT&gt;  and &lt;/SCRIPT&gt; tags and insert it on your page between the  &lt;/HEAD&gt; and &lt;BODY&gt; tags.</p>
<p>The following line sets the length, in seconds, of the timer:</p>
<p><tt>secs = 10</tt></p>
<p>The code decreases the &#8220;secs&#8221; variable by 1 each second. When &#8220;secs&#8221; gets to 0, the clock is stopped and that&#8217;s when you do whatever it is you want to do once the timer is done (such as display a message or send the user to another page).</p>
<p>In the example above, I use a simple form button to start the timer (it also displays the countdown in the status bar). You could also start the timer (that is, run the <strong>InitializeTimer()</strong> function) automatically by adding the following to the &lt;BODY&gt; tag:</p>
<p><tt>onLoad="InitializeTimer()"</tt></p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Print, Email, Share, Enjoy!</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript-timer%2F&amp;partner=sociable" title="Print"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="mailto:?subject=JavaScript%20Timer&amp;body=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript-timer%2F" title="email"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=JavaScript%20Timer%20-%20http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript-timer%2F" title="Twitter"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript-timer%2F&amp;t=JavaScript%20Timer" title="Facebook"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript-timer%2F&amp;title=JavaScript%20Timer&amp;bodytext=Sometimes%20you%20need%20to%20perform%20a%20function%20after%20a%20set%20time%20has%20passed.%20This%20script%20is%20a%20simple%20to%20use%20JavaScript%20timer.%0D%0A%0D%0AHere%27s%20the%20script%3A%0D%0A%26lt%3BSCRIPT%20LANGUAGE%20%3D%20%22JavaScript%22%26gt%3B%0D%0A%26lt%3B%21--%0D%0Avar%20secs%0D%0Avar%20timerID%20%3D%20null%0D%0Avar%20timerRunning%20%3D%20false%0D%0Avar" title="Digg"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript-timer%2F&amp;t=JavaScript%20Timer" title="MySpace"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript-timer%2F&amp;title=JavaScript%20Timer" title="Mixx"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript-timer%2F&amp;title=JavaScript%20Timer&amp;notes=Sometimes%20you%20need%20to%20perform%20a%20function%20after%20a%20set%20time%20has%20passed.%20This%20script%20is%20a%20simple%20to%20use%20JavaScript%20timer.%0D%0A%0D%0AHere%27s%20the%20script%3A%0D%0A%26lt%3BSCRIPT%20LANGUAGE%20%3D%20%22JavaScript%22%26gt%3B%0D%0A%26lt%3B%21--%0D%0Avar%20secs%0D%0Avar%20timerID%20%3D%20null%0D%0Avar%20timerRunning%20%3D%20false%0D%0Avar" title="del.icio.us"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript-timer%2F" title="Technorati"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript-timer%2F&amp;title=JavaScript%20Timer" title="StumbleUpon"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.henriemedia.com/blog/code-library/javascript-timer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bookmark this page JavaScript</title>
		<link>http://www.henriemedia.com/blog/code-library/javascript/bookmark-this-page-javascript/</link>
		<comments>http://www.henriemedia.com/blog/code-library/javascript/bookmark-this-page-javascript/#comments</comments>
		<pubDate>Tue, 27 May 2008 12:00:35 +0000</pubDate>
		<dc:creator>Henrie Media Inc.</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.henriemedia.com/?p=30</guid>
		<description><![CDATA[Here is a handy &#8220;Bookmark this page&#8221; JavaScript I wrote that will work in Internet Explorer, Firefox, Safari and most of the major web browser. The script will prompt the user to bookmark the page they are on. Here is what you need to use this script on your website. Put the following code between [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-346" title="Computer" src="http://www.henriemedia.com/blog/wp-content/uploads/computer-icon.jpg" alt="Computer" width="150" height="130" />Here is a handy &#8220;Bookmark this page&#8221; JavaScript I wrote that will work in Internet Explorer, Firefox, Safari and most of the major web browser. The script will prompt the user to bookmark the page they are on. Here is what you need to use this script on your website.</p>
<p>Put the following code between the &lt;head&gt;&lt;/head&gt; tags of your webpage -</p>
<p><em>&lt;script&gt;<br />
function bookmark(title,url){<br />
if(window.sidebar)<br />
window.sidebar.addPanel(title,url,&#8221;");<br />
else if(window.opera &amp;&amp; window.print){<br />
var elem = document.createElement(&#8216;a&#8217;);<br />
elem.setAttribute(&#8216;href&#8217;,url);<br />
elem.setAttribute(&#8216;title&#8217;,title);<br />
elem.setAttribute(&#8216;rel&#8217;,'sidebar&#8217;);<br />
elem.click();<br />
}<br />
else if(window.external)<br />
window.external.AddFavorite(url,title);</em><em>}<br />
&lt;/script&gt;</em></p>
<p>Put the following script in your Bookmark this page link (this can be a text or image link) -</p>
<p><em>&lt;a href=&#8221;javascript:bookmark(&#8216;Henrie Media Inc.&#8217;,&#8217;</em><em>http://www.henriemedia/&#8217;);&#8221;&gt;Bookmark this page&lt;/a&gt;</em></p>
<p>Make sure you change the parameters (&#8216;title&#8217;, &#8216;url&#8217;) to the &#8216;url&#8217; you want to bookmark and the &#8216;title&#8217; you want the bookmark to say. In my example the &#8216;url&#8217; is &#8220;http://www.henriemedia.com&#8221; and the &#8216;title&#8217; is &#8220;Henrie Media Inc.&#8221;</p>
<p>That&#8217;s it! Your are off and bookmarking. Please leave a comment if you find this post to be helpful.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Print, Email, Share, Enjoy!</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript%2Fbookmark-this-page-javascript%2F&amp;partner=sociable" title="Print"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="mailto:?subject=Bookmark%20this%20page%20JavaScript&amp;body=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript%2Fbookmark-this-page-javascript%2F" title="email"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Bookmark%20this%20page%20JavaScript%20-%20http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript%2Fbookmark-this-page-javascript%2F" title="Twitter"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript%2Fbookmark-this-page-javascript%2F&amp;t=Bookmark%20this%20page%20JavaScript" title="Facebook"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript%2Fbookmark-this-page-javascript%2F&amp;title=Bookmark%20this%20page%20JavaScript&amp;bodytext=Here%20is%20a%20handy%20%22Bookmark%20this%20page%22%20JavaScript%20I%20wrote%20that%20will%20work%20in%20Internet%20Explorer%2C%20Firefox%2C%20Safari%20and%20most%20of%20the%20major%20web%20browser.%20The%20script%20will%20prompt%20the%20user%20to%20bookmark%20the%20page%20they%20are%20on.%20Here%20is%20what%20you%20need%20to%20use%20this%20script" title="Digg"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript%2Fbookmark-this-page-javascript%2F&amp;t=Bookmark%20this%20page%20JavaScript" title="MySpace"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript%2Fbookmark-this-page-javascript%2F&amp;title=Bookmark%20this%20page%20JavaScript" title="Mixx"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript%2Fbookmark-this-page-javascript%2F&amp;title=Bookmark%20this%20page%20JavaScript&amp;notes=Here%20is%20a%20handy%20%22Bookmark%20this%20page%22%20JavaScript%20I%20wrote%20that%20will%20work%20in%20Internet%20Explorer%2C%20Firefox%2C%20Safari%20and%20most%20of%20the%20major%20web%20browser.%20The%20script%20will%20prompt%20the%20user%20to%20bookmark%20the%20page%20they%20are%20on.%20Here%20is%20what%20you%20need%20to%20use%20this%20script" title="del.icio.us"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript%2Fbookmark-this-page-javascript%2F" title="Technorati"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.henriemedia.com%2Fblog%2Fcode-library%2Fjavascript%2Fbookmark-this-page-javascript%2F&amp;title=Bookmark%20this%20page%20JavaScript" title="StumbleUpon"><img src="http://www.henriemedia.com/blog/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.henriemedia.com/blog/code-library/javascript/bookmark-this-page-javascript/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
