<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Jquery on jpcercal.com</title><link>https://jpcercal.com/en/tags/jquery/</link><description>Recent content in Jquery on jpcercal.com</description><generator>Hugo</generator><language>en</language><lastBuildDate>Mon, 26 Aug 2013 17:30:19 +0000</lastBuildDate><atom:link href="https://jpcercal.com/en/tags/jquery/index.xml" rel="self" type="application/rss+xml"/><item><title>How and Why you should include jQuery from Google CDN in WP</title><link>https://jpcercal.com/en/how-and-why-you-should-include-jquery-from-google-cdn-in-wp/</link><pubDate>Mon, 26 Aug 2013 17:30:19 +0000</pubDate><guid>https://jpcercal.com/en/how-and-why-you-should-include-jquery-from-google-cdn-in-wp/</guid><description>&lt;p&gt;&lt;em&gt;jQuery&lt;/em&gt; is a library widely used for web development, and in &lt;em&gt;WordPress&lt;/em&gt; we have this library included in the &lt;em&gt;default&lt;/em&gt; installation package.&lt;/p&gt;&#10;&lt;p&gt;In this article, I&amp;rsquo;ll show you how and why you should replace &lt;em&gt;WordPress&amp;rsquo;s&lt;/em&gt; &lt;em&gt;default&lt;/em&gt; &lt;em&gt;jQuery&lt;/em&gt; with &lt;em&gt;jQuery&lt;/em&gt; from &lt;em&gt;Google CDN (Content Distribution Network)&lt;/em&gt;.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;But why should you replace it?&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;Generally speaking, you should do this so the script loads faster for the end user.&lt;/p&gt;&#10;&lt;p&gt;Here are the points that should lead you to adopt this practice.&lt;/p&gt;</description></item><item><title>jQuery the difference between bind, live, delegate, on</title><link>https://jpcercal.com/en/jquery-the-difference-between-bind-live-delegate-on/</link><pubDate>Fri, 01 Feb 2013 04:07:20 +0000</pubDate><guid>https://jpcercal.com/en/jquery-the-difference-between-bind-live-delegate-on/</guid><description>&lt;p&gt;The &lt;strong&gt;jQuery&lt;/strong&gt; library lets you &lt;em&gt;register events&lt;/em&gt; using the following methods: &lt;strong&gt;bind&lt;/strong&gt;, &lt;strong&gt;live&lt;/strong&gt;, &lt;strong&gt;delegate&lt;/strong&gt;,&#10;&lt;strong&gt;on&lt;/strong&gt;. Do you know when and where to use them? Do you know the difference between them?&lt;/p&gt;&#10;&lt;p&gt;If you don&amp;rsquo;t yet, we suggest reading this article.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;BIND&lt;/strong&gt;&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 2&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 3&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 4&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 5&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 6&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 7&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 8&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 9&#10;&lt;/span&gt;&lt;span class="lnt"&gt;10&#10;&lt;/span&gt;&lt;span class="lnt"&gt;11&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-js" data-lang="js"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// Attach a handler to an event for the elements.&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nx"&gt;eventType&lt;/span&gt; &lt;span class="p"&gt;[,&lt;/span&gt; &lt;span class="nx"&gt;eventData&lt;/span&gt; &lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="nx"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;eventObject&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nx"&gt;eventType&lt;/span&gt; &lt;span class="p"&gt;[,&lt;/span&gt; &lt;span class="nx"&gt;eventData&lt;/span&gt; &lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="nx"&gt;preventBubble&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nx"&gt;events&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// ----------------------------------------------&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// Exemplo:&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;jQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;#botao&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;click&amp;#39;&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;// faz alguma coisa...&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;});&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;Registers events on the elements selected by the &lt;strong&gt;jQuery&lt;/strong&gt; library. It only allows registration on elements&#10;initially present in the &lt;em&gt;DOM&lt;/em&gt;, meaning that if you create elements using &lt;em&gt;javascript&lt;/em&gt;, &lt;em&gt;ajax&lt;/em&gt;.. &lt;strong&gt;bind&lt;/strong&gt; won&amp;rsquo;t&#10;work.&lt;/p&gt;</description></item><item><title>Validating forms with the jQuery Validade plugin</title><link>https://jpcercal.com/en/validating-forms-with-the-jquery-validade-plugin/</link><pubDate>Mon, 21 Jan 2013 13:15:32 +0000</pubDate><guid>https://jpcercal.com/en/validating-forms-with-the-jquery-validade-plugin/</guid><description>&lt;p&gt;Today I introduce you to &lt;strong&gt;jQuery Validade&lt;/strong&gt;, an excellent jQuery plugin developed by the team at&#10;&lt;a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/" title="jQuery Validate"&gt;http://bassistance.de&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;You can download this plugin directly from the developer&amp;rsquo;s site (&lt;em&gt;mentioned above&lt;/em&gt;) or from the&#10;&lt;a href="https://jpcercal.com/en/git-hub-reaches-three-million-users/" title="Git Hub reaches 3 million users"&gt;GitHub&lt;/a&gt; repository&#10;(_&lt;a href="https://github.com/jquery-validation/jquery-validation"&gt;https://github.com/jquery-validation/jquery-validation&lt;/a&gt;).&lt;/p&gt;&#10;&lt;p&gt;If you use &lt;strong&gt;GIT&lt;/strong&gt; for version control, you can run the command below to clone the plugin&amp;rsquo;s&#10;official repository:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ git clone https://github.com/jzaefferer/jquery-validation.git&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;To use this plugin you need to use &lt;a href="http://jquery.com/" title="jQuery"&gt;jQuery&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>jQuery Mask: Masks for form fields</title><link>https://jpcercal.com/en/jquery-mask-masks-for-form-fields/</link><pubDate>Sun, 20 Jan 2013 11:01:36 +0000</pubDate><guid>https://jpcercal.com/en/jquery-mask-masks-for-form-fields/</guid><description>&lt;p&gt;A simple and quick way to add masks to form fields is to use a&#10;&lt;a href="http://jquery.com/" title="jQuery"&gt;jQuery&lt;/a&gt; plugin, this plugin is called&#10;&lt;a href="https://github.com/digitalBush/jquery.maskedinput" title="jQuery Plugin"&gt;Masked Input Plugin&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;To create a &lt;strong&gt;mask&lt;/strong&gt;, you just need to provide a simple &lt;em&gt;javascript&lt;/em&gt; command, with only the following rules:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;em&gt;a&lt;/em&gt; – &lt;em&gt;Represents an alphabetic character (A-Z, a-z)&lt;/em&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;em&gt;9&lt;/em&gt; – &lt;em&gt;Represents a numeric character (0-9)&lt;/em&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;em&gt;*&lt;/em&gt; – &lt;em&gt;Represents an alphanumeric character (A-Z, a-z ,0-9)&lt;/em&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Let&amp;rsquo;s look at some practical examples:&lt;/p&gt;</description></item></channel></rss>