<?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>blog.watashii &#187; javascript</title>
	<atom:link href="http://blog.watashii.com/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.watashii.com</link>
	<description></description>
	<lastBuildDate>Wed, 02 Nov 2011 02:23:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Syntax Highlight Code On Any Page Using Google Code Prettify</title>
		<link>http://blog.watashii.com/2009/10/syntax-highlight-code-on-any-page-using-google-code-prettify/</link>
		<comments>http://blog.watashii.com/2009/10/syntax-highlight-code-on-any-page-using-google-code-prettify/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 13:17:01 +0000</pubDate>
		<dc:creator>watashii</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[highlight]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[prettify]]></category>
		<category><![CDATA[syntax]]></category>

		<guid isPermaLink="false">http://blog.watashii.com/?p=277</guid>
		<description><![CDATA[The Google Code Prettify is a JavaScript module that allows syntax highlighting of any code snippets on a HTML page.  Setting this up on any web page is a simple 3 step process, and is supported on most common browsers. [Demo]   (Based on:  prettify-21-May-2009.zip) [Download Source Files] 1) Include the JavaScript and CSS file within [...]


Related Posts:<ol><li><a href='http://blog.watashii.com/2008/11/overlay-slideshow-images-with-lightbox-2/' rel='bookmark' title='Permanent Link: Overlay &#038; Slideshow Images with Lightbox 2'>Overlay &#038; Slideshow Images with Lightbox 2</a></li>
<li><a href='http://blog.watashii.com/2009/03/get-url-variables-in-javascript-html/' rel='bookmark' title='Permanent Link: Get URL Variables in JavaScript &#038; HTML'>Get URL Variables in JavaScript &#038; HTML</a></li>
<li><a href='http://blog.watashii.com/2008/11/a-better-lightbox-using-jquery/' rel='bookmark' title='Permanent Link: A Better LightBox Using jQuery'>A Better LightBox Using jQuery</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-280" title="prettify00" src="http://blog.watashii.com/wp-content/uploads/2009/10/prettify00.png" alt="prettify00" width="375" height="250" /></p>
<p>The <a href="http://code.google.com/p/google-code-prettify/" target="_blank">Google Code Prettify</a> is a JavaScript module that allows syntax highlighting of any code snippets on a HTML page.  Setting this up on any web page is a simple 3 step process, and is supported on most common browsers.</p>
<p>[<a title="Google Code Prettify Demo" href="http://www.watashii.com/code/googlecode_prettify/watashii/" target="_blank">Demo</a>]   (Based on:  prettify-21-May-2009.zip)<br />
[<a title="Google Code Prettify Demo" href="http://www.watashii.com/code/googlecode_prettify/googlecode_prettify_watashii.zip">Download Source Files</a>]</p>
<p><span id="more-277"></span></p>
<p>1) Include the JavaScript and CSS file within the head of the HTML page</p>
<p><img class="alignnone size-full wp-image-281" title="prettify01" src="http://blog.watashii.com/wp-content/uploads/2009/10/prettify01.png" alt="prettify01" width="575" height="75" /></p>
<p>2) Include the action <em>onload=&#8221;prettyPrint()&#8221;</em> within the body element</p>
<p><img class="alignnone size-full wp-image-282" title="prettify02" src="http://blog.watashii.com/wp-content/uploads/2009/10/prettify02.png" alt="prettify02" width="488" height="41" /></p>
<p>3) Wrap your code snippet between pre tags: <em>&lt;pre class=&#8221;prettyprint&#8221;&gt;&#8230;&lt;/pre&gt;</em></p>
<p><img class="alignnone size-full wp-image-283" title="prettify03" src="http://blog.watashii.com/wp-content/uploads/2009/10/prettify03.png" alt="prettify03" width="521" height="345" /></p>
<h3>Notes:</h3>
<p>For code snippets containing <em>&#8220;&lt;&#8221;</em> and <em>&#8220;&gt;&#8221;</em> characters, <em>&#8220;;&amp;gt&#8221;</em> and <em>&#8220;;&amp;lt&#8221;</em> must be replaced in order to work, for example HTML code.</p>
<p>You can explicitly specify the code language to render, for example in Step 3 we can extend this by forcing it to Perl, using <em>&lt;pre </em><em>class=&#8221;prettyprint lang-<strong>perl</strong>&#8220;</em><em>&gt;&#8230;&lt;/pre&gt;<br />
</em>The languages available are <em>&#8220;bsh&#8221;, &#8220;c&#8221;, &#8220;cc&#8221;, &#8220;cpp&#8221;, &#8220;cs&#8221;, &#8220;csh&#8221;, &#8220;cyc&#8221;, &#8220;cv&#8221;, &#8220;htm&#8221;, &#8220;html&#8221;, &#8220;java&#8221;, &#8220;js&#8221;, &#8220;m&#8221;, &#8220;mxml&#8221;, &#8220;perl&#8221;, &#8220;pl&#8221;, &#8220;pm&#8221;, &#8220;py&#8221;, &#8220;rb&#8221;, &#8220;sh&#8221;, &#8220;xhtml&#8221;, &#8220;xml&#8221;, &#8220;xsl&#8221;</em>.</p>
<p>Line numbers can be included by added <em>&lt;span&gt; 1: &lt;/span&gt;</em> at the beginning of each line (this is a bit of manual work though).</p>
<p>Lisp, CSS, Haskell, LUA, OCAML, SML, F#, Visual Basic, SQL, Protocol Buffers, and WikiText languages are also support by inclusion of <em>src/lang-*.js</em> files.  See <a href="http://google-code-prettify.googlecode.com/svn/trunk/README.html" target="_blank">FAQ</a>.</p>


<p>Related Posts:<ol><li><a href='http://blog.watashii.com/2008/11/overlay-slideshow-images-with-lightbox-2/' rel='bookmark' title='Permanent Link: Overlay &#038; Slideshow Images with Lightbox 2'>Overlay &#038; Slideshow Images with Lightbox 2</a></li>
<li><a href='http://blog.watashii.com/2009/03/get-url-variables-in-javascript-html/' rel='bookmark' title='Permanent Link: Get URL Variables in JavaScript &#038; HTML'>Get URL Variables in JavaScript &#038; HTML</a></li>
<li><a href='http://blog.watashii.com/2008/11/a-better-lightbox-using-jquery/' rel='bookmark' title='Permanent Link: A Better LightBox Using jQuery'>A Better LightBox Using jQuery</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.watashii.com/2009/10/syntax-highlight-code-on-any-page-using-google-code-prettify/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get URL Variables in JavaScript &amp; HTML</title>
		<link>http://blog.watashii.com/2009/03/get-url-variables-in-javascript-html/</link>
		<comments>http://blog.watashii.com/2009/03/get-url-variables-in-javascript-html/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 12:19:10 +0000</pubDate>
		<dc:creator>watashii</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[url]]></category>

		<guid isPermaLink="false">http://blog.watashii.com/?p=172</guid>
		<description><![CDATA[The following structure stores variables within a request URL: http://www.mydomain.com/index.html?month=January&#38;day=Tuesday To read the variables within the index HTML file, we must process the URL string entirely, since there is no built-in functions which magically does it.  The following JavaScript demonstrates this: function getUrlVars() { var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&#38;'); [...]]]></description>
			<content:encoded><![CDATA[<p>The following structure stores variables within a request URL:</p>
<p><strong>http://www.mydomain.com/index.html?<span style="color: #ff0000;">month</span>=<span style="color: #ff0000;">January</span>&amp;<span style="color: #ff0000;">day</span>=<span style="color: #ff0000;">Tuesday</span></strong></p>
<p>To read the variables within the index HTML file, we must process the URL string entirely, since there is no built-in functions which magically does it.  The following JavaScript demonstrates this:</p>
<pre><code>function getUrlVars()
{
  var vars = [], hash;
  var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&amp;');
  for(var i = 0; i &lt; hashes.length; i++)
  {
    hash = hashes[i].split('=');
    vars.push(hash[0]);
    vars[hash[0]] = hash[1];
  }
  return vars;
}</code></pre>
<p>To use the variables, we run the following to extract the values:</p>
<pre><code>var myHash = getUrlVars();
alert(myHash['month']);   // prompts the value 'January'
alert(myHash['day']);     // prompts the value 'Tuesday'</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.watashii.com/2009/03/get-url-variables-in-javascript-html/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A Better LightBox Using jQuery</title>
		<link>http://blog.watashii.com/2008/11/a-better-lightbox-using-jquery/</link>
		<comments>http://blog.watashii.com/2008/11/a-better-lightbox-using-jquery/#comments</comments>
		<pubDate>Sun, 16 Nov 2008 01:55:23 +0000</pubDate>
		<dc:creator>watashii</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[lightbox]]></category>

		<guid isPermaLink="false">http://blog.watashii.com/?p=101</guid>
		<description><![CDATA[The jQuery lightBox plugin (by Leandro Vieira Pinho) uses the jQuery JavaScript library to create an overlay effect of opening up images on top of a web page, and creating a navigable slideshow view.  See my demo below. Setting this up on your own web page is an easy 2-step process: include the JavaScript and [...]


Related Posts:<ol><li><a href='http://blog.watashii.com/2008/11/overlay-slideshow-images-with-lightbox-2/' rel='bookmark' title='Permanent Link: Overlay &#038; Slideshow Images with Lightbox 2'>Overlay &#038; Slideshow Images with Lightbox 2</a></li>
<li><a href='http://blog.watashii.com/2009/10/syntax-highlight-code-on-any-page-using-google-code-prettify/' rel='bookmark' title='Permanent Link: Syntax Highlight Code On Any Page Using Google Code Prettify'>Syntax Highlight Code On Any Page Using Google Code Prettify</a></li>
<li><a href='http://blog.watashii.com/2009/03/get-url-variables-in-javascript-html/' rel='bookmark' title='Permanent Link: Get URL Variables in JavaScript &#038; HTML'>Get URL Variables in JavaScript &#038; HTML</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-103" title="jquerylightbox" src="http://blog.watashii.com/wp-content/uploads/2008/11/jquerylightbox.png" alt="" width="400" height="289" /></p>
<p>The <a href="http://leandrovieira.com/projects/jquery/lightbox/" target="_blank">jQuery lightBox</a> plugin (by <a href="http://blog.watashii.com/wp-admin/leandrovieira.com" target="_blank">Leandro Vieira Pinho</a>) uses the <a href="http://jquery.com/" target="_blank">jQuery</a> JavaScript library to create an overlay effect of opening up images on top of a web page, and creating a navigable slideshow view.  See my demo below.</p>
<p>Setting this up on your own web page is an easy 2-step process: include the JavaScript and CSS on the webpage header, and then call the jQuery function.  The only change required is on the header.</p>
<p>This plugin is an improvement over the <a title="Overlay &amp; Slideshow Images with Lightbox 2" href="http://blog.watashii.com/2008/11/overlay-slideshow-images-with-lightbox-2/" target="_blank">LighBox2 plugin</a> which was demonstrated earlier, because we didn&#8217;t need to modify our link tags to activate it, thanks to the jQuery element selector.</p>
<p>[<a title="jQuery lightBox Demo" href="http://www.watashii.com/code/jquery_lightbox/watashii/" target="_blank">Demo</a>]<br />
[<a title="jQuery lightBox Source Files" href="http://www.watashii.com/code/jquery_lightbox/jquery_lightbox_watashii.zip">Download Source Files</a>]</p>


<p>Related Posts:<ol><li><a href='http://blog.watashii.com/2008/11/overlay-slideshow-images-with-lightbox-2/' rel='bookmark' title='Permanent Link: Overlay &#038; Slideshow Images with Lightbox 2'>Overlay &#038; Slideshow Images with Lightbox 2</a></li>
<li><a href='http://blog.watashii.com/2009/10/syntax-highlight-code-on-any-page-using-google-code-prettify/' rel='bookmark' title='Permanent Link: Syntax Highlight Code On Any Page Using Google Code Prettify'>Syntax Highlight Code On Any Page Using Google Code Prettify</a></li>
<li><a href='http://blog.watashii.com/2009/03/get-url-variables-in-javascript-html/' rel='bookmark' title='Permanent Link: Get URL Variables in JavaScript &#038; HTML'>Get URL Variables in JavaScript &#038; HTML</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.watashii.com/2008/11/a-better-lightbox-using-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Overlay &amp; Slideshow Images with Lightbox 2</title>
		<link>http://blog.watashii.com/2008/11/overlay-slideshow-images-with-lightbox-2/</link>
		<comments>http://blog.watashii.com/2008/11/overlay-slideshow-images-with-lightbox-2/#comments</comments>
		<pubDate>Sat, 15 Nov 2008 14:30:15 +0000</pubDate>
		<dc:creator>watashii</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[lightbox]]></category>

		<guid isPermaLink="false">http://blog.watashii.com/?p=99</guid>
		<description><![CDATA[The Lightbox2 plugin uses the Prototype and Scriptaculous JavaScript libraries to create an overlay effect of opening up images on top of a web page, and creating a navigable slideshow view. Setting this up on your own web page is an easy 2-step process: include the JavaScript and CSS on the header, and then on [...]


Related Posts:<ol><li><a href='http://blog.watashii.com/2008/11/a-better-lightbox-using-jquery/' rel='bookmark' title='Permanent Link: A Better LightBox Using jQuery'>A Better LightBox Using jQuery</a></li>
<li><a href='http://blog.watashii.com/2009/10/syntax-highlight-code-on-any-page-using-google-code-prettify/' rel='bookmark' title='Permanent Link: Syntax Highlight Code On Any Page Using Google Code Prettify'>Syntax Highlight Code On Any Page Using Google Code Prettify</a></li>
<li><a href='http://blog.watashii.com/2009/03/get-url-variables-in-javascript-html/' rel='bookmark' title='Permanent Link: Get URL Variables in JavaScript &#038; HTML'>Get URL Variables in JavaScript &#038; HTML</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-100" title="lighbox_demo" src="http://blog.watashii.com/wp-content/uploads/2008/11/lighbox.png" alt="" width="400" height="303" /></p>
<p>The <a href="http://www.huddletogether.com/projects/lightbox2/" target="_self">Lightbox2</a> plugin uses the <a href="http://www.prototypejs.org/" target="_blank">Prototype</a> and <a href="http://script.aculo.us/" target="_blank">Scriptaculous</a> JavaScript libraries to create an overlay effect of opening up images on top of a web page, and creating a navigable slideshow view.</p>
<p>Setting this up on your own web page is an easy 2-step process: include the JavaScript and CSS on the header, and then on each link tag embed the <em>rel=&#8221;lightbox&#8221; </em>and <em>title=&#8221;my caption&#8221;</em> attributes.</p>
<p>[<a title="LightBox 2 Demo" href="http://www.watashii.com/code/lightbox2/watashii/" target="_blank">Demo</a>]<br />
[<a title="LightBox 2 Source Files" href="http://www.watashii.com/code/lightbox2/lightbox2_watashii.zip">Download Source Files</a>]</p>
<p><span id="more-99"></span></p>
<p><span style="text-decoration: underline;">Notes:</span> I had to include the following CSS due to the background overlay didnt cover the entire page.</p>
<pre><code>&lt;style type="text/css"&gt;
body{margin: 0; padding:0;}
&lt;/style&gt;</code></pre>


<p>Related Posts:<ol><li><a href='http://blog.watashii.com/2008/11/a-better-lightbox-using-jquery/' rel='bookmark' title='Permanent Link: A Better LightBox Using jQuery'>A Better LightBox Using jQuery</a></li>
<li><a href='http://blog.watashii.com/2009/10/syntax-highlight-code-on-any-page-using-google-code-prettify/' rel='bookmark' title='Permanent Link: Syntax Highlight Code On Any Page Using Google Code Prettify'>Syntax Highlight Code On Any Page Using Google Code Prettify</a></li>
<li><a href='http://blog.watashii.com/2009/03/get-url-variables-in-javascript-html/' rel='bookmark' title='Permanent Link: Get URL Variables in JavaScript &#038; HTML'>Get URL Variables in JavaScript &#038; HTML</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.watashii.com/2008/11/overlay-slideshow-images-with-lightbox-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

