<?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>Mike&#039;s Site Blog</title>
	<atom:link href="http://www.mikesite.me/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.mikesite.me/blog</link>
	<description>A web developer&#039;s workbook</description>
	<lastBuildDate>Thu, 19 Nov 2009 02:43:42 +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>Open window HTML validator friendly</title>
		<link>http://www.mikesite.me/blog/?p=16</link>
		<comments>http://www.mikesite.me/blog/?p=16#comments</comments>
		<pubDate>Thu, 19 Nov 2009 02:42:22 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[HTML Validation]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.mikesite.me/blog/?p=16</guid>
		<description><![CDATA[Some time ago I found this script which enables you to open links in a new window. Typically links in html were something like this: Mike's Site = &#60;a href="http://www.mikesite.me" target="_blank"&#62;Mike's Site&#60;/a&#62; The instruction target=&#8221;_blank&#8221; was the one that make the link open in a new window. Now the W3C decided that you shouldn&#8217;t use [...]]]></description>
			<content:encoded><![CDATA[<p>Some time ago I found this script which enables you to open links in a new window. Typically links in html were something like this:</p>
<pre><em><a href="http://www.mikesite.me" target="_blank">Mike's Site</a> = &lt;a href="http://www.mikesite.me" target="_blank"&gt;Mike's Site&lt;/a&gt;</em></pre>
<p>The instruction <em>target=&#8221;_blank&#8221;</em> was the one that make the link open in a new window. Now the <a href="http://www.w3.org/TR/css3-hyperlinks/">W3C</a> decided that you shouldn&#8217;t use that anymore. Browsers still support it, but if you want to html validate your site, that would throw you an error. So here is a little javascript function that fix that:</p>
<p>function externalLinks() {<br />
if (!document.getElementsByTagName) return;<br />
var anchors = document.getElementsByTagName(&#8220;a&#8221;);<br />
for (var i=0; i var anchor = anchors[i];<br />
if (anchor.getAttribute(&#8220;href&#8221;) &amp;&amp; anchor.getAttribute(&#8220;rel&#8221;) == &#8220;external&#8221;)<br />
anchor.target = &#8220;_blank&#8221;;<br />
}<br />
}</p>
<p>Usage: simply put in your links the attribute <em>rel=&#8221;external&#8221;</em> and include that function and then call it after all the document have been loaded with something like:</p>
<p>window.onload = externalLinks;</p>
<p>Hope that would help you, contact me if you need further indications. I would love to help <img src='http://www.mikesite.me/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  <a href="mailto:me@mikesite.me">Me@mikesite.me</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikesite.me/blog/?feed=rss2&#038;p=16</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multidimensional Arrays on JavaScript</title>
		<link>http://www.mikesite.me/blog/?p=11</link>
		<comments>http://www.mikesite.me/blog/?p=11#comments</comments>
		<pubDate>Fri, 13 Nov 2009 03:42:05 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Snippet]]></category>

		<guid isPermaLink="false">http://www.mikesite.me/blog/?p=11</guid>
		<description><![CDATA[Here is the code: var myArray=MultiDimensionalArray(2,3); function MultiDimensionalArray(iRows,iCols) { var i; var j; var a = new Array(iRows); for (i=0; i < iRows; i++) { a[i] = new Array(iCols); for (j=0; j < iCols; j++) { a[i][j] = &#8220;&#8221;; } } return(a); } Now you can use myArray[0..1][0..2]]]></description>
			<content:encoded><![CDATA[<p>Here is the code:<br />
var myArray=MultiDimensionalArray(2,3);<br />
function MultiDimensionalArray(iRows,iCols)<br />
{<br />
var i; var j;   var a = new Array(iRows);<br />
  for (i=0; i < iRows; i++)<br />
  {<br />
      a[i] = new Array(iCols);<br />
      for (j=0; j < iCols; j++)<br />
      {<br />
          a[i][j] = &#8220;&#8221;;<br />
      }<br />
  }<br />
  return(a);<br />
} </p>
<p>Now you can use myArray[0..1][0..2]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikesite.me/blog/?feed=rss2&#038;p=11</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trim on JavaScript</title>
		<link>http://www.mikesite.me/blog/?p=9</link>
		<comments>http://www.mikesite.me/blog/?p=9#comments</comments>
		<pubDate>Sun, 22 Mar 2009 03:35:53 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Snippet]]></category>

		<guid isPermaLink="false">http://www.mikesite.me/blog/?p=9</guid>
		<description><![CDATA[Here is a little function you might find useful to enable trim function on JavaScript: function trim(myString) { for(i=0; i< myString.length; ) { if(myString.charAt(i)==" ") myString = myString.substring(i+1, myString.length); else break; } for(i= myString.length-1; i>=0; i= myString.length-1) { if(myString.charAt(i)==&#8221; &#8220;) myString = myString.substring(0,i); else break; } return myString; }]]></description>
			<content:encoded><![CDATA[<p>Here is a little function you might find useful to enable trim function on JavaScript:</p>
<p>function trim(myString)<br />
{<br />
for(i=0; i< myString.length; )<br />
{<br />
if(myString.charAt(i)==" ")<br />
myString = myString.substring(i+1, myString.length);<br />
else<br />
break;<br />
}</p>
<p>for(i= myString.length-1; i>=0; i= myString.length-1)<br />
{<br />
if(myString.charAt(i)==&#8221; &#8220;)<br />
myString = myString.substring(0,i);<br />
else<br />
break;<br />
}</p>
<p>return myString;<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikesite.me/blog/?feed=rss2&#038;p=9</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP echo usage tip</title>
		<link>http://www.mikesite.me/blog/?p=1</link>
		<comments>http://www.mikesite.me/blog/?p=1#comments</comments>
		<pubDate>Mon, 25 Feb 2008 11:21:53 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://mikesite.me/blog/?p=1</guid>
		<description><![CDATA[If you have done at least a &#8220;hello world&#8221; in php, you might be aware of the function echo. Along the Internet I have seen people passing as an argument  of the echo function a concatenation of any given values. The function syntax of echo should be something like this: void echo ( string $arg1 [, string $... [...]]]></description>
			<content:encoded><![CDATA[<p>If you have done at least a &#8220;hello world&#8221; in <a href="http://en.wikipedia.org/wiki/PHP" target="_blank">php</a>, you might be aware of the function <strong><em>echo</em></strong>. Along the Internet I have seen people passing as an argument  of the echo function a concatenation of any given values. The function syntax of <a href="http://cr.php.net/manual/en/function.echo.php" target="_blank">echo</a> should be something like this:</p>
<p><span><span>void</span></span> <span><strong>echo</strong></span> ( <span><span>string</span> <tt style="font-family: Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-style: italic;">$arg1</tt></span> [, <span><span>string</span> <tt style="font-family: Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-style: italic;">$...</tt></span> ] )</p>
<p>So as you might imagine you could do something like this:</p>
<p>&lt;?php echo &#8220;Hello &#8220;, $userName; ?&gt;</p>
<p>Instead of:</p>
<p>&lt;?php echo &#8220;Hello &#8221; . $userName; ?&gt;</p>
<p>Saving your self an additional step of concatenate 2 or more values before each output. Specially in large scale scripts this should be helpful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikesite.me/blog/?feed=rss2&#038;p=1</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

