<?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>Mas que Wordpress - Tutoriales, recursos web, JQuery y PHP, Wordpress , twitter y muchos recursos más &#187; javascript</title>
	<atom:link href="http://www.masquewordpress.com/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.masquewordpress.com</link>
	<description>Tutoriales y recursos web sobre JQuery , PHP, Wordpress , twitter. Aprende diseño web y programación</description>
	<lastBuildDate>Fri, 03 Feb 2012 19:33:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Convertir cadenas de texto en números en Javascript</title>
		<link>http://www.masquewordpress.com/convertir-cadenas-de-texto-en-numeros-en-javascript/</link>
		<comments>http://www.masquewordpress.com/convertir-cadenas-de-texto-en-numeros-en-javascript/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 13:24:12 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Tutoriales]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[tutorial jquery]]></category>

		<guid isPermaLink="false">http://www.masquewordpress.com/?p=910</guid>
		<description><![CDATA[Sencillas funciones que no por ello son menos importantes para poder convertir strings en int o floats. Aunque estas funciones son de Javascript las pueden emplear con jQuery o cualquier otro framework para convertir sus cadenas de texto en números y así poder restar, sumar o realizar cualquier otra operación que necesiten. Convertir string a [...]]]></description>
			<content:encoded><![CDATA[<p>Sencillas funciones que no por ello son menos importantes para poder convertir <strong>strings</strong> en <strong>int</strong> o <strong>floats</strong>. Aunque estas funciones son de <strong>Javascript</strong> las pueden emplear con jQuery o cualquier otro framework para convertir sus cadenas de texto en números y así poder restar, sumar o realizar cualquier otra operación que necesiten.<br />
<span id="more-910"></span></p>
<p>Convertir string a entero</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> texto <span style="color: #339933;">=</span> <span style="color: #3366CC;">'1234'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// text + 10 = 123410</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> numero<span style="color: #339933;">;</span>
numero <span style="color: #339933;">=</span> parseInt<span style="color: #009900;">&#40;</span>texto<span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span><span style="color: #CC0000;">10</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">//numero= 1244</span></pre></td></tr></table></div>

<p>String a decimal:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> texto <span style="color: #339933;">=</span> <span style="color: #3366CC;">'1234.0987'</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">//texto + 10 = 1234.098710</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> entero <span style="color: #339933;">=</span> parseInt<span style="color: #009900;">&#40;</span>text<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// entero = 1234</span>
<span style="color: #003366; font-weight: bold;">var</span> decimal <span style="color: #339933;">=</span> parseFloat<span style="color: #009900;">&#40;</span>text<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// decimal = 1234.0987</span>
<span style="color: #006600; font-style: italic;">//decimal + 10 = 1244.098710</span></pre></td></tr></table></div>

<p>Reducir el número de decimales:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> numero <span style="color: #339933;">=</span> <span style="color: #CC0000;">1234.0987</span><span style="color: #339933;">;</span>
&nbsp;
numero <span style="color: #339933;">=</span> numero.<span style="color: #660066;">toFixed</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// numero = 1234.09</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.masquewordpress.com/convertir-cadenas-de-texto-en-numeros-en-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>7 códigos JQuery que todos deberían tener</title>
		<link>http://www.masquewordpress.com/7-codigos-jquery-que-todos-deberian-tener/</link>
		<comments>http://www.masquewordpress.com/7-codigos-jquery-que-todos-deberian-tener/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 22:51:32 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Recursos]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://masquewordpress.com/?p=440</guid>
		<description><![CDATA[Hoy les traigo un pequeño recopilatorio de JQuery code snippets que hacen la vida más fácil. Aunque para la mayoría de estos ejemplos existen extensos plugins que hacen lo mismo, con unas simples lineas de código podemos realizar lo mismo y a su vez aprendemos como funciona. 1. Texto que desaparece en cajas de búsquedas [...]]]></description>
			<content:encoded><![CDATA[<p>Hoy les traigo un pequeño recopilatorio de JQuery code snippets que hacen la vida más fácil. Aunque para la mayoría de estos ejemplos existen extensos <a href="http://masquewordpress.com/category/plugins/">plugins</a> que hacen lo mismo, con unas simples lineas de código podemos realizar lo mismo y a su vez aprendemos como funciona.</p>
<p><span id="more-440"></span></p>
<h3>1. Texto que desaparece en cajas de búsquedas</h3>
<p>Este ejemplo mostrará un texto en la caja de búsqueda que al hacer click para escribir desaparecerá . Y si nos vamos de la caja sin escribir nada volverá a aparecer.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #003366; font-weight: bold;">var</span> texto<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;Buscar&quot;</span><span style="color: #339933;">;</span>
jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#whats-new&quot;</span><span style="color: #009900;">&#41;</span>
  .<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span>texto<span style="color: #009900;">&#41;</span>
  .<span style="color: #000066;">focus</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> jQuery<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
  .<span style="color: #000066;">blur</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> jQuery<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #3366CC;">''</span> <span style="color: #339933;">?</span> jQuery<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span>texto<span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h3>2. Cambiar el tamaño de fuente en la página</h3>
<p>Pequeño script que permite al usuario agrandar o achicar el tamaño de la fuente dependiendo en que botón haga click.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"> $<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// Resetear al tamaño original</span>
 <span style="color: #003366; font-weight: bold;">var</span> originalFontSize <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'html'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'font-size'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.resetFont&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'html'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'font-size'</span><span style="color: #339933;">,</span> originalFontSize<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #006600; font-style: italic;">// Aumentar tamaño</span>
 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.aumentar&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 <span style="color: #003366; font-weight: bold;">var</span> currentFontSize <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'html'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'font-size'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #003366; font-weight: bold;">var</span> currentFontSizeNum <span style="color: #339933;">=</span> parseFloat<span style="color: #009900;">&#40;</span>currentFontSize<span style="color: #339933;">,</span> <span style="color: #CC0000;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #003366; font-weight: bold;">var</span> newFontSize <span style="color: #339933;">=</span> currentFontSizeNum<span style="color: #339933;">*</span><span style="color: #CC0000;">1.2</span><span style="color: #339933;">;</span>
 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'html'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'font-size'</span><span style="color: #339933;">,</span> newFontSize<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #006600; font-style: italic;">// Disminuir tamaño</span>
 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.disminuir&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 <span style="color: #003366; font-weight: bold;">var</span> currentFontSize <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'html'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'font-size'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #003366; font-weight: bold;">var</span> currentFontSizeNum <span style="color: #339933;">=</span> parseFloat<span style="color: #009900;">&#40;</span>currentFontSize<span style="color: #339933;">,</span> <span style="color: #CC0000;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #003366; font-weight: bold;">var</span> newFontSize <span style="color: #339933;">=</span> currentFontSizeNum<span style="color: #339933;">*</span><span style="color: #CC0000;">0.8</span><span style="color: #339933;">;</span>
 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'html'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'font-size'</span><span style="color: #339933;">,</span> newFontSize<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span></pre></td></tr></table></div>

<h3>3.Pasar variables de PHP $_GET and javascript</h3>
<p>Con este código podremos pasar las variables $_GET de php a javascript para poder utilizarlas si es necesario</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> searchArray <span style="color: #339933;">=</span> document.<span style="color: #660066;">location</span>.<span style="color: #660066;">search</span>.<span style="color: #660066;">substring</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&amp;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #006600; font-style: italic;">//Removemos '?' y separamos las variables</span>
&nbsp;
<span style="color: #006600; font-style: italic;">//Ahora hacemos un loop en searchArray y creamos otro array llamado  GET</span>
 <span style="color: #003366; font-weight: bold;">var</span> GET <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
 <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>searchTerm <span style="color: #000066; font-weight: bold;">in</span> searchArray<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 searchTerm.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;=&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//Dividimos searchTerm en propiedades y valores</span>
 GET<span style="color: #009900;">&#91;</span>searchTerm<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> searchTerm<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//Añadimos la propiedad y el valor al array GET</span>
 <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<h3>4. Refrescar parte de una Web mediante AJAX</h3>
<p>Este código es extremadamente útil cuando queremos que una parte de nuestra web ( un widget por ej) se actualice constantemente.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 setInterval<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#content&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">load</span><span style="color: #009900;">&#40;</span>location.<span style="color: #660066;">href</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; #content &gt; *&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">5000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h3>5. Evitar conflictos entre librerías</h3>
<p>JQuery incluye al igual que otras librerías el alias $ .Con este método podremos cambiar dicho alias por cualquiera que nos plazca.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"> <span style="color: #003366; font-weight: bold;">var</span> $timersys <span style="color: #339933;">=</span> jQuery.<span style="color: #660066;">noConflict</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">//Ahora podemos usar $timersys en vez de '$'</span>
 $timersys<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h3>6. Detectar el navegador</h3>
<p>Sencilla forma de detectar los diferentes navegadores</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"> <span style="color: #006600; font-style: italic;">//A. Para Safari</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> $.<span style="color: #660066;">browser</span>.<span style="color: #660066;">safari</span> <span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">//B. Para cualquier versión inferior a IE7</span>
 <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$.<span style="color: #660066;">browser</span>.<span style="color: #660066;">msie</span> <span style="color: #339933;">&amp;&amp;</span> $.<span style="color: #660066;">browser</span>.<span style="color: #660066;">version</span> <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">7</span> <span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">//C. Para IE7 y versiones anteriores</span>
 <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$.<span style="color: #660066;">browser</span>.<span style="color: #660066;">msie</span> <span style="color: #339933;">&amp;&amp;</span> $.<span style="color: #660066;">browser</span>.<span style="color: #660066;">version</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;1.8&quot;</span> <span style="color: #009900;">&#41;</span></pre></td></tr></table></div>

<h3>7. Deshabilitar click derecho del mouse</h3>
<p>No siempre queremos que puedan hacer click derecho en nuestra web.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"> $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;contextmenu&quot;</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.masquewordpress.com/7-codigos-jquery-que-todos-deberian-tener/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Como limitar los caracteres de un textarea</title>
		<link>http://www.masquewordpress.com/como-limitar-los-caracteres-de-un-textarea/</link>
		<comments>http://www.masquewordpress.com/como-limitar-los-caracteres-de-un-textarea/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 16:52:28 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[Tutoriales]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://masquewordpress.com/?p=355</guid>
		<description><![CDATA[A diferencia de los &#60;input type=&#8221;text&#8221;&#62; , los campos &#60;textarea&#62; no tienen el atributo de maxlength. Digamos que dado un campo de texto como el siguiente: 1 &#60;textarea id=&#34;descripcion&#34; onkeyup=&#34;contar(this);&#34; cols=&#34;50&#34; rows=&#34;8&#34; name=&#34;descripcion&#34;&#62; &#60;/textarea&#62;&#60;span id=&#34;letras&#34;&#62;3000/3000 caracteres&#60;/span&#62; Si queremos contar y mostrar los caracteres escritos en un span, tan solo necesitamos esta pequeña función. 1 2 [...]]]></description>
			<content:encoded><![CDATA[<p>A diferencia de los &lt;input type=&#8221;text&#8221;&gt; , los campos  &lt;textarea&gt; no tienen el atributo de maxlength. Digamos que dado un campo de texto como el siguiente:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">textarea</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;descripcion&quot;</span> <span style="color: #000066;">onkeyup</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;contar(this);&quot;</span> <span style="color: #000066;">cols</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;50&quot;</span> <span style="color: #000066;">rows</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;8&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;descripcion&quot;</span>&gt;</span> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">textarea</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;letras&quot;</span>&gt;</span>3000/3000 caracteres<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span></pre></td></tr></table></div>

<p>Si queremos contar y mostrar los caracteres escritos en un span, tan solo necesitamos esta pequeña función.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> contar<span style="color: #009900;">&#40;</span>input<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #006600; font-style: italic;">//Comprobamos que no pase de 3000 caracteres y si pasa, que borre los sobrantes</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>input.<span style="color: #660066;">value</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;=</span> <span style="color: #CC0000;">3000</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
input.<span style="color: #660066;">value</span> <span style="color: #339933;">=</span> input.<span style="color: #660066;">value</span>.<span style="color: #660066;">substring</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span><span style="color: #CC0000;">3000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #006600; font-style: italic;">//alamacenamos el resto</span>
<span style="color: #003366; font-weight: bold;">var</span> resto <span style="color: #339933;">=</span> <span style="color: #CC0000;">3000</span> <span style="color: #339933;">-</span> input.<span style="color: #660066;">value</span>.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">//imprimimos los caracteres restantes en el span</span>
<span style="color: #003366; font-weight: bold;">var</span> final<span style="color: #339933;">=</span>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'letras'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
final.<span style="color: #660066;">innerHTML</span><span style="color: #339933;">=</span>resto<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;/3000 caracteres&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Como pueden ver, es muy facil y tan solo bastaron unas lineas de javascript. Saludosss</p>
]]></content:encoded>
			<wfw:commentRss>http://www.masquewordpress.com/como-limitar-los-caracteres-de-un-textarea/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Introducción a AJAX, Javascript, CSS, XHTML</title>
		<link>http://www.masquewordpress.com/introduccion-a-ajax-javascript-css-xhtml/</link>
		<comments>http://www.masquewordpress.com/introduccion-a-ajax-javascript-css-xhtml/#comments</comments>
		<pubDate>Thu, 21 May 2009 15:01:12 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[Recursos]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[libros gratis]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://masquewordpress.com/?p=49</guid>
		<description><![CDATA[Hoy les traigo una página que me ayudo mucho en mis comienzos. Estoy hablando de Librosweb, en ella podemos encontrar una serie de PDFs escritos en su mayoria por profesores con los contenidos que imparten en sus cursos. Los libros son totalmente gratuitos y se pueden leer en la web o descargarlos. La verdad que [...]]]></description>
			<content:encoded><![CDATA[<p>Hoy les traigo una página que me ayudo mucho en mis comienzos. Estoy hablando de <a title="Libros gratuitos" href="http://librosweb.es" target="_blank">Librosweb</a>, en ella podemos encontrar una serie de PDFs escritos en su mayoria por profesores con los contenidos que imparten en sus cursos.</p>
<p style="text-align: center;"><img class="aligncenter" title="LibrosWeb" src="http://librosweb.es/website/css/images/logo_big.gif" alt="" width="258" height="50" /></p>
<p>Los libros son totalmente gratuitos y se pueden leer en la web o descargarlos. La verdad que estan muy bien como complemento y referencia, la mayoria incluye ejemplos y ejercicios para ir practicando a medida que se aprende.</p>
<p>Acá les dejo el listado completo:</p>
<h2><span>Programación web</span></h2>
<h3>Introducción a AJAX :</h3>
<ul>
<li>Comenzando desde cero y llegando hasta las técnicas más avanzadas.</li>
<li>Incluye Google Maps, Prototype, jQuery y decenas de ejemplos.</li>
</ul>
<p style="text-align: center;"><a href="http://librosweb.es/ajax/index.html" target="_blank">Empezar a leerlo</a></p>
<h3>Introducción a JavaScript :</h3>
<ul>
<li>Creado para diseñadores web sin experiencia en programación.</li>
<li>Aprende a manejar eventos, validar formularios y crear otras utilidades comunes.</li>
</ul>
<p style="text-align: center;"><a href="http://librosweb.es/javascript/index.html" target="_blank">Empezar a leerlo</a></p>
<h2><span>Diseño web</span></h2>
<h3>Introducción a CSS :</h3>
<ul>
<li>Guía completa para aplicar estilos a las páginas web.</li>
<li>Incluye las propiedades de CSS 2.1 y decenas de ejemplos.</li>
</ul>
<p style="text-align: center;"><a href="http://librosweb.es/css/index.html" target="_blank">Empezar a leerlo</a></p>
<h3>CSS avanzado :</h3>
<ul>
<li>Técnicas imprescindibles como sustitución de texto, <em>sprites</em>, sombras y transparencias</li>
<li>Buenas prácticas y recomendaciones de los mejores diseñadores</li>
<li>Frameworks CSS y diseño de páginas con YUI</li>
<li>Referencia imprescindible para diseñadores web avanzados</li>
</ul>
<p style="text-align: center;"><a href="http://librosweb.es/css_avanzado/" target="_blank">Empezar a leerlo</a></p>
<h3>Referencia de CSS 2.1 :</h3>
<ul>
<li>Las 115 propiedades de CSS 2.1 explicadas detalladamente</li>
<li>Incluye más de 300 ejemplos originales</li>
</ul>
<p style="text-align: center;"><a href="http://librosweb.es/referencia/css/index.html" target="_blank">Empezar a leerlo</a></p>
<h3>Introducción a XHTML :</h3>
<ul>
<li>Guía completa para crear páginas web, con más de 60 ejemplos.</li>
<li>Aprende cómo crear páginas web accesibles y que validen.</li>
</ul>
<p style="text-align: center;"><a href="http://librosweb.es/xhtml/index.html" target="_blank">Empezar a leerlo</a></p>
<p style="text-align: left;">
]]></content:encoded>
			<wfw:commentRss>http://www.masquewordpress.com/introduccion-a-ajax-javascript-css-xhtml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

