<?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>Jeremy Massel&#039;s Blog &#187; Javascript</title>
	<atom:link href="http://masseltech.com/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://masseltech.com</link>
	<description>Because sometimes I have good ideas too</description>
	<lastBuildDate>Mon, 19 Sep 2011 21:51:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Drop-in jQuery placeholder fix</title>
		<link>http://masseltech.com/2011/02/drop-in-jquery-placeholder-fix/</link>
		<comments>http://masseltech.com/2011/02/drop-in-jquery-placeholder-fix/#comments</comments>
		<pubDate>Fri, 04 Feb 2011 21:19:01 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=237</guid>
		<description><![CDATA[If you want to enable the &#8220;placeholder&#8221; attribute of input boxes in browsers that don&#8217;t support it, simply download this file, and include it anywhere on your page. It will copy the native functionality, and disable itself in browsers that already support the attribute. This file will require a reasonably new version of jQuery to [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to enable the &#8220;placeholder&#8221; attribute of input boxes in browsers that don&#8217;t support it, simply download this file, and include it anywhere on your page. It will copy the native functionality, and disable itself in browsers that already support the attribute. </p>
<p>This file will require a reasonably new version of jQuery to run correctly (and yes, it works in no-conflict mode).</p>
<p><a href='http://masseltech.com/wp-content/uploads/2011/02/jQuery.placeholder.1.0.1.min_.js'>jQuery.placeholder.1.0.1.min</a></p>
<p>Comments, questions? Feel free to comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2011/02/drop-in-jquery-placeholder-fix/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Pure PHP Pagination</title>
		<link>http://masseltech.com/2010/03/pure-php-pagination/</link>
		<comments>http://masseltech.com/2010/03/pure-php-pagination/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 04:37:45 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[useful]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=162</guid>
		<description><![CDATA[So, for a while I&#8217;ve been looking for a ridiculously simple way to paginate data stored in a table. And while I love PHP, it just doesn&#8217;t come with some of the free things I take for granted in .Net Today, while working on a pretty simple plugin, I wanted to add this functionality, and [...]]]></description>
			<content:encoded><![CDATA[<p>So, for a while I&#8217;ve been looking for a ridiculously simple way to paginate data stored in a table. And while I love PHP, it just doesn&#8217;t come with some of the free things I take for granted in .Net </p>
<p>Today, while working on a pretty simple plugin, I wanted to add this functionality, and I didn&#8217;t want to waste a bunch of time. I was given a link to this great script: <a href="http://www.warkensoft.com/2009/12/paginated-navigation-bar/">http://www.warkensoft.com/2009/12/paginated-navigation-bar/</a></p>
<p>It took me about a minute to implement the functionality. I then spent another 5 minutes doing CSS and that was it. Done. I&#8217;m not usually one for link sharing, but this made my life much easier. Hopefully it can make yours easier too. </p>
<p>The solution is pure PHP, no javascript required. Some day, I may try to expand upon this to include javascripty goodness, because that&#8217;s pretty much the only thing that could make it better</p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2010/03/pure-php-pagination/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Run JavaScript function every n seconds</title>
		<link>http://masseltech.com/2010/01/run-javascript-function-every-n-seconds/</link>
		<comments>http://masseltech.com/2010/01/run-javascript-function-every-n-seconds/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 19:15:55 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[useful]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=132</guid>
		<description><![CDATA[//tell javascript to run a function in 1 second setTimeout ("myFunction()", 1000 ); function myFunction(){ //do stuff //once the function is finished, queue this function up to run again in 1 second setTimeout ( "myFunction()", 1000 ); }]]></description>
			<content:encoded><![CDATA[<p><code><br />
//tell javascript to run a function in 1 second<br />
setTimeout ("myFunction()", 1000 );</p>
<p>function myFunction(){<br />
        //do stuff</p>
<p>        //once the function is finished, queue this function up to run again in 1 second<br />
	setTimeout ( "myFunction()", 1000 );<br />
}</p>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2010/01/run-javascript-function-every-n-seconds/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Get latitude and longitude of an address using google maps</title>
		<link>http://masseltech.com/2009/09/get-latitude-and-longitude-of-an-address-using-google-mapst/</link>
		<comments>http://masseltech.com/2009/09/get-latitude-and-longitude-of-an-address-using-google-mapst/#comments</comments>
		<pubDate>Sun, 13 Sep 2009 04:33:51 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[useful]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=98</guid>
		<description><![CDATA[Google doesn&#8217;t make it easy to show you the latitude and longitude of an address you search in google maps, but there&#8217;s an easy way to get the info. go to google maps, type the address, and click search once you&#8217;ve found it, go to your address bar and clear what&#8217;s in it paste: javascript:void(prompt('',gApplication.getMap().getCenter())); [...]]]></description>
			<content:encoded><![CDATA[<p>Google doesn&#8217;t make it easy to show you the latitude and longitude of an address you search in google maps, but there&#8217;s an easy way to get the info.</p>
<ol>
<li>go to google maps, type the address, and click search</li>
<li>once you&#8217;ve found it, go to your address bar and clear what&#8217;s in it</li>
<li>paste: <code>javascript:void(prompt('',gApplication.getMap().getCenter()));</code> into the address bar</li>
<li>use the coordinates for whatever you wish!</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2009/09/get-latitude-and-longitude-of-an-address-using-google-mapst/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cause a field to be auto-focused when the page is done loading</title>
		<link>http://masseltech.com/2009/05/cause-a-field-to-be-auto-focused-when-the-page-is-done-loading/</link>
		<comments>http://masseltech.com/2009/05/cause-a-field-to-be-auto-focused-when-the-page-is-done-loading/#comments</comments>
		<pubDate>Wed, 06 May 2009 17:39:45 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[useful]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=31</guid>
		<description><![CDATA[So, wouldn&#8217;t it be user friendly, if when you went to a form page in a document, if the cursor was automagically positioned at the first field in the form? Why, yes it would. Try: Event.observe(window, 'load', function(){ try { $('eventName').focus(); } catch (e) {} }); after your &#60;/form&#62; tag. This requires the prototype javascript [...]]]></description>
			<content:encoded><![CDATA[<p>So, wouldn&#8217;t it be user friendly, if when you went to a form page in a document, if the cursor was automagically positioned at the first field in the form?</p>
<p>Why, yes it would. Try:</p>
<pre>

Event.observe(window, 'load', function(){
     try {
          $('eventName').focus();
     } 

     catch (e) {}
});
</pre>
<p><span>after your &lt;/form&gt; tag. </span> This requires the prototype javascript library</p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2009/05/cause-a-field-to-be-auto-focused-when-the-page-is-done-loading/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript example to do an auto-generated slug on a WordPress Plugin</title>
		<link>http://masseltech.com/2009/04/javascript_auto_generated_slug/</link>
		<comments>http://masseltech.com/2009/04/javascript_auto_generated_slug/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 00:46:48 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[internet]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=24</guid>
		<description><![CDATA[&#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#34;&#62; &#60;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&#62; &#60;head&#62; &#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=UTF-8&#34; /&#62; &#60;title&#62;Untitled Document&#60;/title&#62; &#60;script type=&#34;text/javascript&#34;&#62; function duplicateField(field1, field2){ var theLength = document.getElementById(field1).value.length - 1; var theString = document.getElementById(field1).value; for(var i=0; i &#60; theString.length-1; i++){ if(theString.charAt(i) == &#34; &#34;){ theString = setCharAt(theString, i, &#34;_&#34;); } } document.getElementById(field2).style.color = &#34;#c9c9c9&#34;; document.getElementById(field2).value = [...]]]></description>
			<content:encoded><![CDATA[<p><code><br />
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;<br />
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;<br />
&lt;head&gt;<br />
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;<br />
&lt;title&gt;Untitled Document&lt;/title&gt;<br />
&lt;script type=&quot;text/javascript&quot;&gt;<br />
function duplicateField(field1, field2){<br />
     var theLength = document.getElementById(field1).value.length - 1;<br />
     var theString = document.getElementById(field1).value;<br />
     for(var i=0; i &lt; theString.length-1; i++){<br />
if(theString.charAt(i) == &quot; &quot;){<br />
theString = setCharAt(theString, i, &quot;_&quot;);<br />
}<br />
}<br />
document.getElementById(field2).style.color = &quot;#c9c9c9&quot;;<br />
document.getElementById(field2).value = theString;<br />
}<br />
function setCharAt(str,index,chr) {<br />
if(index &gt; str.length-1) return str;<br />
return str.substr(0,index) + chr + str.substr(index+1);<br />
}<br />
function changeColorBack(fieldName){<br />
document.getElementById(fieldName).style.color = &quot;#000000&quot;;<br />
}<br />
&lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;p&gt;<br />
&lt;input id=&quot;field1&quot; onkeyup=&quot;duplicateField('field1', 'field2');&quot; type=&quot;text&quot; /&gt;<br />
&lt;/p&gt;<br />
&lt;p&gt;&lt;br /&gt;<br />
&lt;input id=&quot;field2&quot; type=&quot;text&quot; onfocus=&quot;changeColorBack('field2');&quot; /&gt;&lt;br /&gt;<br />
&lt;/p&gt;<br />
&lt;p&gt;<br />
&lt;span id=&quot;span1&quot;&gt;&lt;/span&gt;<br />
&lt;input id=&quot;submitButton&quot; type=&quot;submit&quot; value=&quot;Submit&quot; /&gt;<br />
&lt;/p&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2009/04/javascript_auto_generated_slug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

