<?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>David Tavarez's Home at davidtavarez.com &#187; javascript</title>
	<atom:link href="http://www.davidtavarez.com/archives/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.davidtavarez.com</link>
	<description>Just another weblog...</description>
	<lastBuildDate>Sat, 31 Jul 2010 16:00:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>PHP functions in Javascript</title>
		<link>http://www.davidtavarez.com/archives/php-functions-in-javascript/</link>
		<comments>http://www.davidtavarez.com/archives/php-functions-in-javascript/#comments</comments>
		<pubDate>Mon, 02 Feb 2009 18:38:28 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.davidtavarez.com/?p=373</guid>
		<description><![CDATA[I like javascript, but I spend too much time wrting some functions just to use it more than once.  In most cases I uses prototype.js to create a shorter code but still being long. Recently I was porting some basic php functions to javascript like  isset(), array_keys(), in_array(), explode() and many more. I was very [...]]]></description>
			<content:encoded><![CDATA[<p>I like javascript, but I spend too much time wrting some functions just to use it more than once.  In most cases I uses prototype.js to create a shorter code but still being long. Recently I was porting some basic php functions to javascript like  isset(), array_keys(), in_array(), explode() and many more. I was very frustrated, because I had to write a mini-framework just to create a simple application. Within a few hours had hundreds of lines of code.</p>
<p>Then on Internet I found this: PHP.js, an open source project in which they try to port PHP functions to JavaScript. By including the PHP.JS library in your own projects, you can use your favorite PHP functions on the client-side. This convenience may speed up development for PHP developers who are increasingly confronted with client-side technology.</p>
<p><strong>The History of PHP.JS</strong></p>
<p>A developer called <a title="Kevin van Zonneveld" href="http://kevin.vanzonneveld.net/about/" onclick="urchinTracker('/outgoing/kevin.vanzonneveld.net/about/?referer=');">Kevin van Zonneveld</a> was once working on a project with a lot of client(JS) / server(PHP) interaction, and he found himself coding PHP functions (like base64_decode &amp; urldecode) in JavaScript to smoothen communication between the two languages. He stored the stored the functions in a file called php.js which was included in the project. Kevin decided to share the little library online, which triggered the enthusiasm of a lot of PHP developers longing for PHP functionality in JavaScript. The project was open sourced in 2008, and many people contributed their own functions in the comments sections of Kevin's blog. It was decided that the library deserved a bigger home, and a face of its own, and so the PHP.JS core team developed the phpjs.org website.</p>
<p><strong>List of functions</strong></p>
<p>To see the list of functions click here <a title="PHP.js: Functions Overview" href="http://phpjs.org/functions/index" onclick="urchinTracker('/outgoing/phpjs.org/functions/index?referer=');">PHP.JS: Functions Overview</a>.</p>
<p>More Information:  <a title="PHP.js: Pages" href="http://phpjs.org/" onclick="urchinTracker('/outgoing/phpjs.org/?referer=');">http://phpjs.org/</a></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.davidtavarez.com/archives/php-functions-in-javascript/" target="_blank" onclick="urchinTracker('/outgoing/www.facebook.com/share.php?u=http_//www.davidtavarez.com/archives/php-functions-in-javascript/&amp;referer=');"><img src="http://www.davidtavarez.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.davidtavarez.com/archives/php-functions-in-javascript/" target="_blank" title="Share on Facebook" onclick="urchinTracker('/outgoing/www.facebook.com/share.php?u=http_//www.davidtavarez.com/archives/php-functions-in-javascript/&amp;referer=');">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.davidtavarez.com/archives/php-functions-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Powerful tools for manipulating images using javascript</title>
		<link>http://www.davidtavarez.com/archives/powerful-tools-for-manipulating-images-using-javascript/</link>
		<comments>http://www.davidtavarez.com/archives/powerful-tools-for-manipulating-images-using-javascript/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 18:33:31 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.davidtavarez.com/?p=247</guid>
		<description><![CDATA[Surfing on Internet for a while, I found a wonderful toolbox. These are a compilation of several script to manipulate images. This is the list: busy.js: The library allows you to add/remove loading indicators to block-level elements on your webpages. shiftzoom.js: Allows you to add/remove zoom and pan functionality to oversized images on your webpages. [...]]]></description>
			<content:encoded><![CDATA[<p>Surfing on Internet for a while, I found a wonderful toolbox. These are a compilation of several script to manipulate images. This is the list:</p>
<p><a title="busy.js" href="http://busy.netzgesta.de/" onclick="urchinTracker('/outgoing/busy.netzgesta.de/?referer=');">busy.js</a>: The library allows you to add/remove loading indicators to block-level elements on your webpages.</p>
<p><a title="busy.js" href="http://shiftzoom.netzgesta.de/" onclick="urchinTracker('/outgoing/shiftzoom.netzgesta.de/?referer=');">shiftzoom.js</a>: Allows you to add/remove zoom and pan functionality to oversized images on your webpages.</p>
<p><a title="busy.js" href="http://sphere.netzgesta.de/" onclick="urchinTracker('/outgoing/sphere.netzgesta.de/?referer=');">sphere.js</a>: Simulates a spherical image effect.</p>
<p><a title="busy.js" href="http://corner.netzgesta.de/" onclick="urchinTracker('/outgoing/corner.netzgesta.de/?referer=');">corner.js</a>: The script allows you to add individual corners, shadings and shadows to images on your webpages.</p>
<p><a title="busy.js" href="http://glossy.netzgesta.de/" onclick="urchinTracker('/outgoing/glossy.netzgesta.de/?referer=');">glossy.js:</a> Simulates a glossy shaded and beveled button look.</p>
<p><a title="busy.js" href="http://instant.netzgesta.de/" onclick="urchinTracker('/outgoing/instant.netzgesta.de/?referer=');">instant.js</a>: Simulates an instant picture look including tilt.</p>
<p><a title="busy.js" href="http://bevel.netzgesta.de/" onclick="urchinTracker('/outgoing/bevel.netzgesta.de/?referer=');">bevel.js</a>: This script allows you to add bevels with individual glowing, shading and shining to images on your webpages.</p>
<p><a title="busy.js" href="http://slided.netzgesta.de/" onclick="urchinTracker('/outgoing/slided.netzgesta.de/?referer=');">slided.js</a>: This script allows you to add individual colors, shadings and shadows to images on your webpages.</p>
<p><a title="busy.js" href="http://filmed.netzgesta.de/" onclick="urchinTracker('/outgoing/filmed.netzgesta.de/?referer=');">filmed.js</a>: Simulates a film strip look including reflection.</p>
<p><a title="busy.js" href="http://mapper.netzgesta.de/" onclick="urchinTracker('/outgoing/mapper.netzgesta.de/?referer=');">mapper.js</a>: Emulates native area highlighting.</p>
<p><a title="busy.js" href="http://curl.netzgesta.de/" onclick="urchinTracker('/outgoing/curl.netzgesta.de/?referer=');">curl.js</a>: Simulates a page curl image effect.</p>
<p><a title="busy.js" href="http://edge.netzgesta.de/" onclick="urchinTracker('/outgoing/edge.netzgesta.de/?referer=');">edge.js</a>: This script allows you to add individual masks (inc. inbuilt mask) to images on your webpages.</p>
<p><a title="busy.js" href="http://reflex.netzgesta.de/" onclick="urchinTracker('/outgoing/reflex.netzgesta.de/?referer=');">reflex.js</a>: Allows you to add individual borders, tiltings and reflections to images on your webpages.</p>
<p><a title="busy.js" href="http://loupe.netzgesta.de/" onclick="urchinTracker('/outgoing/loupe.netzgesta.de/?referer=');">loupe.js</a>: This script allows you to add a loupe for magnifying (inc. start viewpoint) to an image on your webpage.</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.davidtavarez.com/archives/powerful-tools-for-manipulating-images-using-javascript/" target="_blank" onclick="urchinTracker('/outgoing/www.facebook.com/share.php?u=http_//www.davidtavarez.com/archives/powerful-tools-for-manipulating-images-using-javascript/&amp;referer=');"><img src="http://www.davidtavarez.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.davidtavarez.com/archives/powerful-tools-for-manipulating-images-using-javascript/" target="_blank" title="Share on Facebook" onclick="urchinTracker('/outgoing/www.facebook.com/share.php?u=http_//www.davidtavarez.com/archives/powerful-tools-for-manipulating-images-using-javascript/&amp;referer=');">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.davidtavarez.com/archives/powerful-tools-for-manipulating-images-using-javascript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Limit textarea length using javascript</title>
		<link>http://www.davidtavarez.com/archives/limit-textarea-length-using-javascript/</link>
		<comments>http://www.davidtavarez.com/archives/limit-textarea-length-using-javascript/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 20:31:50 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.davidtavarez.com/?p=142</guid>
		<description><![CDATA[This is a simple code, but useful. First, the javascript function: function limit&#40;n,id&#41;&#123; // n is the number of max characters // id is the id of the textarea element text = document.getElementById&#40;id&#41;; if&#40;text.value.length &#38;gt;= n&#41;&#123; //alert(&#34;sorry, the text is too long&#34;); text.value = text.value.substring&#40;0, n-1&#41;; &#125; &#125; Then, the html implementation: &#60;textarea id=&#34;textoalimitar&#34; onkeypress=&#34;limit(10,'textoalimitar');&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>This is a simple code, but useful.</p>
<p>First, the javascript function:</p>
<pre class="javascript"><span style="color: #003366; font-weight: bold;">function</span> limit<span style="color: #66cc66;">&#40;</span>n,id<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
        <span style="color: #009900; font-style: italic;">// n is the number of max characters</span>
        <span style="color: #009900; font-style: italic;">// id is the id of the textarea element</span>
	text = document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span>id<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>text.<span style="color: #006600;">value</span>.<span style="color: #006600;">length</span> &amp;gt;= n<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
		<span style="color: #009900; font-style: italic;">//alert(&quot;sorry, the text is too long&quot;);</span>
		text.<span style="color: #006600;">value</span> = text.<span style="color: #006600;">value</span>.<span style="color: #006600;">substring</span><span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;">0</span>, n<span style="color: #CC0000;">-1</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre>
<p>Then, the html implementation:</p>
<pre class="html4strict"><span style="color: #009900;"><a href="http://december.com/html/4/element/textarea.html" onclick="urchinTracker('/outgoing/december.com/html/4/element/textarea.html?referer=');"><span style="color: #000000; font-weight: bold;">&lt;textarea</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;textoalimitar&quot;</span>
<span style="color: #000066;">onkeypress</span>=<span style="color: #ff0000;">&quot;limit(10,'textoalimitar');&quot;</span> <span style="color: #000066;">cols</span>=<span style="color: #ff0000;">&quot;45&quot;</span> <span style="color: #000066;">rows</span>=<span style="color: #ff0000;">&quot;5&quot;</span>
 <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;textoalimitar&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/textarea&gt;</span></span></pre>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.davidtavarez.com/archives/limit-textarea-length-using-javascript/" target="_blank" onclick="urchinTracker('/outgoing/www.facebook.com/share.php?u=http_//www.davidtavarez.com/archives/limit-textarea-length-using-javascript/&amp;referer=');"><img src="http://www.davidtavarez.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.davidtavarez.com/archives/limit-textarea-length-using-javascript/" target="_blank" title="Share on Facebook" onclick="urchinTracker('/outgoing/www.facebook.com/share.php?u=http_//www.davidtavarez.com/archives/limit-textarea-length-using-javascript/&amp;referer=');">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.davidtavarez.com/archives/limit-textarea-length-using-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
