<?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>Maurício Faustino</title>
	<atom:link href="http://www.mauriciofaustino.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mauriciofaustino.com</link>
	<description>DevOps</description>
	<lastBuildDate>Thu, 28 Mar 2013 13:56:43 +0000</lastBuildDate>
	<language>pt-BR</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Agile Brazil 2013</title>
		<link>http://www.mauriciofaustino.com/2013/03/agile-brazil-2013/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=agile-brazil-2013</link>
		<comments>http://www.mauriciofaustino.com/2013/03/agile-brazil-2013/#comments</comments>
		<pubDate>Wed, 27 Mar 2013 11:43:29 +0000</pubDate>
		<dc:creator>Maurício Faustino</dc:creator>
				<category><![CDATA[Bloggando]]></category>
		<category><![CDATA[Destaque]]></category>

		<guid isPermaLink="false">http://www.mauriciofaustino.com/?p=391</guid>
		<description><![CDATA[A Agile Brazil é a mais relevante conferência brasileira sobre Métodos Ágeis de desenvolvimento de software. O evento não possui fins lucrativos e é organizado por especialistas em agilidade de diversas partes do Brasil que compartilham do objetivo de incentivar e disseminar a cultura Ágil por todo o país.]]></description>
				<content:encoded><![CDATA[<p>A <a title="Agile Brazil" href="http://www.agilebrazil.com/" target="_blank">Agile Brazil</a> é a mais relevante conferência brasileira sobre Métodos Ágeis de desenvolvimento de software. O evento não possui fins lucrativos e é organizado por especialistas em agilidade de diversas partes do Brasil que compartilham do objetivo de incentivar e disseminar a cultura Ágil por todo o país.</p>
<p>O principal objetivo dessa edição é atingir gestores, líderes, desenvolvedores, inovadores e fornecedores de serviço de software em geral que, de alguma maneira, desejam contratar e desenvolver produtos de forma ágil em empresas da iniciativa privada e no governo Brasileiro.</p>
<p>Neste ano a Agile Brazil, maior evento de agilidade da América Latina, acontecerá em <strong>Brasília-DF</strong> nos dias <strong>26, 27 e 28 de Junho de 2013</strong>. E as inscrições já estão abertas pelo site: <a href="http://www.agilebrazil.com/2013/pt/inscricao/" target="_blank">http://www.agilebrazil.<wbr />com/2013/pt/inscricao/ </a></p>
<h2>Desconto</h2>
<p>Existe um <b>desconto</b> especial para Caravanas/Grupos:</p>
<p>5 a 12 pessoas: 10%<br />
até 30 pessoas: 15%<br />
até 50 pessoas: 25%</p>
<p>Organize seu grupo e <a title="Inscrição para o Agile Brazil" href="http://www.agilebrazil.com/2013/pt/inscricao/" target="_blank">inscreva-se</a>.</p>
<h2>Agilidade no Governo</h2>
<p>Esta edição de 2013 promoverá a integração do ecossistema ágil com o ecossistema do governo, das grandes empresas e das startups. Por meio dessa integração entre esses diferentes ecossistemas, acreditamos que poderemos catalisar mudanças sustentáveis, não por rupturas, mas sim pela interoperação de ideias.</p>
<h2>Palestrantes</h2>
<p>Este ano o Agile Brazil terá excelentes palestrantes, como por exemplo:</p>
<h4>Niels Pflaeging</h4>
<div>
<p><img class="alignleft" alt="" src="http://www.agilebrazil.com/2013/wp-content/uploads/2013/03/niels-pflaeging-300px.png" width="180" height="180" />Niels é uma das maiores autoridades do mundo na BetaCodex (anteriormente: o “Beyond Budgeting model”). Ele publicou três livros e muitos artigos sobre o assunto. Desde 2002, viajou mais de 20 países, apresentando e discutindo a mentalidade BetaCodex e dando vida ao modelo através de seu trabalho de consultoria.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>
<div>
<h4>Patrick Kua</h4>
<p><img class="alignright" alt="" src="http://www.agilebrazil.com/2013/wp-content/uploads/2013/03/pat-kua-300px.png" width="180" height="180" />Patrick Kua trabalha como um ativo especialista generalista pela Thoughtworks e não gosta de ser colocado em uma caixa. Patrick pode ser encontrado muitas vezes liderando times técnicos, frequentemente atuando como coach pessoal e de organizações em lean e métodos ágeis e, às vezes, como facilitador de situações adversas. Patrick é fascinado por elementos de aprendizado e melhoria contínua, sempre ajudando outros a desenvolverem entusiasmo por esses mesmos elementos.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>
<div>
<h4>Alexandre Gomes</h4>
<p><img class="alignleft" alt="" src="http://www.agilebrazil.com/2013/wp-content/uploads/2013/03/ale-gomes-300px.png" width="180" height="180" />Alexandre Gomes acredita no software como instrumento de transformação social. Atuando na área há mais de 20 anos, já foi servidor público, trabalhou em grandes multinacionais, como Oracle e Sun Microsystems, e leva hoje uma vida de equilíbrios administrando seu próprio negócio, a SEA Tecnologia. Em Brasília, junto com sua equipe, foi pioneiro na prestação de serviços profissionais em Software Livre e Métodos Ágeis para o Governo Federal e compartilha hoje com seus clientes a visão da TI como política pública para a entrega de valor ao cidadão, da promoção da transparência, da participação e do controle social.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>
<h2>Edições Anteriores</h2>
<p>Em 2010, em <strong>Porto Alegre-RS</strong>, reunimos no mesmo palco <strong>Martin Fowler, Philippe Kruchten, David Hussman</strong> e <strong>Klaus Wuestefeld</strong>, além de mais de 50 outras sessões com os mais experientes agilistas do Brasil.</p>
<p>Em 2011, um evento de mesma dimensão foi realizado em <strong>Fortaleza-CE</strong> com a presença de <strong>Jim Highsmith, Joshua Kerievsky, Vinícius Teles</strong> e <strong>Kenji Hiranabe</strong>.</p>
<p>Em 2012, a conferência foi sediada em <strong>São Paulo-SP</strong> e reuniu grandes empresas com os mais experientes profissionais do mercado brasileiro de agilidade. Tivemos a presença de <strong>Neal Ford, James Shore</strong> e <strong>Khawaja Shams, Johanna Rothman</strong> e <strong>Jack London</strong>.</p>
<p>&nbsp;</p>
<p><img alt="" src="http://submissoes.agilebrazil.com/assets/2013_logo-159edccc84efe35791d116531626deac.png" /><br />
<br />
Venha Participar conosco do <a title="Agile Brazil" href="http://www.agilebrazil.com.br" target="_blank">Agile Brazil</a>. O maior encontro de agilidade da América Latina!<br />
Acesse <a title="Agile Brazil" href="http://www.agilebrazil.com.br" target="_blank">www.AgileBrazil.com.br</a> e faça sua inscrição<br />
Siga-nos no twitter <a title="@AgileBrazil no Twitter" href="https://twitter.com/agilebrazil" target="_blank">@AgileBrazil</a> e acompanhe nossa hastag <a title="#AgileBR no Twitter" href="https://twitter.com/search?q=%23agilebr" target="_blank">#AgileBR</a><br />
Visite nossa Página no Facebook <a title="Agile Brazil no Facebook" href="http://www.facebook.com/AgileBrazil" target="_blank">http://www.facebook.com/AgileBrazil</a><br />
De <strong>26 a 28 de Junho</strong>. Nos vemos em <a title="AgileBrazil em Brasília" href="http://www.agilebrazil.com/2013/pt/brasilia/" target="_blank">Brasília</a>!</p>
<p>Nos vemos no evento!<br />
Veja mais em: <a href="http://www.agilebrazil.com.br/">www.agilebrazil.com.br</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mauriciofaustino.com/2013/03/agile-brazil-2013/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Meu primeiro aplicativo Android</title>
		<link>http://www.mauriciofaustino.com/2013/01/meu-primeiro-aplicativo-android/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=meu-primeiro-aplicativo-android</link>
		<comments>http://www.mauriciofaustino.com/2013/01/meu-primeiro-aplicativo-android/#comments</comments>
		<pubDate>Tue, 22 Jan 2013 15:09:11 +0000</pubDate>
		<dc:creator>Maurício Faustino</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://www.mauriciofaustino.com/?p=283</guid>
		<description><![CDATA[Fala pessoal, a um tempo atrás criei o primeiro aplicativo android, o <a href="https://play.google.com/store/apps/details?id=com.mauriciofaustino.porextenso" target="_blank">Por Extenso</a>


<p style="text-align:center"><a href="https://play.google.com/store/apps/details?id=com.mauriciofaustino.porextenso" target="_blank"><img src="http://www.mauriciofaustino.com/wp-content/uploads/2013/01/porExtensoSite.png" alt="Baixe agora o Por Extenso" /></a></p>
]]></description>
				<content:encoded><![CDATA[<p>Fala pessoal, após ficar um bom tempo desenvolvendo aplicativos de testes para android, resolvi colocar um deles no google play para sentir o feedback do pessoal.</p>
<p>A ideia inicial é que ele fosse bem simples, o foco foi apenas para treinar o desenvolvimento de aplicativos. Sua funcionalidade é minimalista, você digita um número e o aplicativo converte o número digitado (inclusive os decimais) por extenso.</p>
<p>Convido você a baixar, testar o aplicativo e, é claro, mandar sugestões.</p>
<div id="attachment_342" class="wp-caption aligncenter" style="width: 446px"><a href="https://play.google.com/store/apps/details?id=com.mauriciofaustino.porextenso" target="_blank" rel="attachment wp-att-342"><img class="size-full wp-image-342 " style="border: 1px solid black;" alt="Baixe o aplicativo Por Extenso no Google Play" src="http://www.mauriciofaustino.com/wp-content/uploads/2013/01/porExtensoSite.png" width="436" height="213" /></a><p class="wp-caption-text">Baixe o aplicativo Por Extenso no Google Play</p></div>
<p>&nbsp;</p>
<p>Abaixo segue algumas imagens do aplicativo:<br />
<a href="http://www.mauriciofaustino.com/wp-content/uploads/2013/01/Screenshot_2012-09-13-14-43-07.png" target="_blank"><img class="wp-image-344 alignleft" style="margin-left: 2px; margin-right: 2px;" alt="Screenshot_2012-09-13-14-43-07" src="http://www.mauriciofaustino.com/wp-content/uploads/2013/01/Screenshot_2012-09-13-14-43-07.png" width="163" height="291" /></a><a href="http://www.mauriciofaustino.com/wp-content/uploads/2013/01/Screenshot_2012-09-13-14-43-47.png" target="_blank"><img class="wp-image-345 alignleft" style="margin-left: 2px; margin-right: 2px;" alt="Screenshot_2012-09-13-14-43-47" src="http://www.mauriciofaustino.com/wp-content/uploads/2013/01/Screenshot_2012-09-13-14-43-47.png" width="163" height="291" /></a> <a href="http://www.mauriciofaustino.com/wp-content/uploads/2013/01/Screenshot_2012-09-13-14-44-05.png" target="_blank"><img class="alignnone  wp-image-346" style="margin-left: 2px; margin-right: 2px;" alt="Screenshot_2012-09-13-14-44-05" src="http://www.mauriciofaustino.com/wp-content/uploads/2013/01/Screenshot_2012-09-13-14-44-05.png" width="163" height="291" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mauriciofaustino.com/2013/01/meu-primeiro-aplicativo-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Importando nova Autoridade Certificadora no Android</title>
		<link>http://www.mauriciofaustino.com/2012/07/importando-nova-autoridade-certificadora-no-android/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=importando-nova-autoridade-certificadora-no-android</link>
		<comments>http://www.mauriciofaustino.com/2012/07/importando-nova-autoridade-certificadora-no-android/#comments</comments>
		<pubDate>Fri, 27 Jul 2012 12:59:42 +0000</pubDate>
		<dc:creator>Maurício Faustino</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://www.mauriciofaustino.com/?p=270</guid>
		<description><![CDATA[Nos últimos meses venho me aventurando no desenvolvimento de aplicativos Android, vou tentar passar para vocês algumas dicas do que aprendi. Tive uma grande dificuldade para importar uma nova unidade certificadora para protocolos seguros para o dispositivo, mas em minhas pesquisas descobri uma forma bem fácil de fazer isso. Basta acessar o site http://www.realmb.com/droidCert/ e [...]]]></description>
				<content:encoded><![CDATA[<p>Nos últimos meses venho me aventurando no desenvolvimento de aplicativos Android, vou tentar passar para vocês algumas dicas do que aprendi.</p>
<p>Tive uma grande dificuldade para importar uma nova unidade certificadora para protocolos seguros para o dispositivo, mas em minhas pesquisas descobri uma forma bem fácil de fazer isso.</p>
<p>Basta acessar o site <a href="http://www.realmb.com/droidCert/" target="_blank">http://www.realmb.com/droidCert/</a> e fazer o upload do arquivo da unidade certificadora ou colocar a URL dele.</p>
<p>O sistema vai armazenar o arquivo, e disponibiliza-lo para download com o cabeçalho HTTP no formato “<em>Content-Type: application/x-x509-ca-cert</em>” e pronto, o navegador do seu dispositivo irá identificar o cabeçalho e fará a instalação do certificado.</p>
<p>Nas minhas outras tentativas, tentei colocar o arquivo no cartão SD do dispositivo e instala-lo, mas sem sucesso.</p>
<p><strong>Dica:</strong> você pode fazer o upload do arquivo por um computador pois após isso, o site disponibiliza o QR Code para você fazer o download do certificado pelo celular.</p>
<p>Para visualizar os certificados instalados basta acessar: <strong>Configurações</strong> &gt; <strong>Segurança</strong> &gt; <strong>Credenciais confiáveis</strong> &gt; <strong>Usuário</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mauriciofaustino.com/2012/07/importando-nova-autoridade-certificadora-no-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Conhecendo JQuery Mobile</title>
		<link>http://www.mauriciofaustino.com/2011/03/conhecendo-jquery-mobile/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=conhecendo-jquery-mobile</link>
		<comments>http://www.mauriciofaustino.com/2011/03/conhecendo-jquery-mobile/#comments</comments>
		<pubDate>Tue, 29 Mar 2011 23:01:13 +0000</pubDate>
		<dc:creator>Maurício Faustino</dc:creator>
				<category><![CDATA[JQuery Mobile]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[criar]]></category>
		<category><![CDATA[exemplo]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[jquery mobile]]></category>
		<category><![CDATA[site]]></category>

		<guid isPermaLink="false">http://www.mauriciofaustino.com/?p=202</guid>
		<description><![CDATA[Nessa semana estava navegando pela internet quando sem querer me deparei com uma novidade, o <a href="http://jquerymobile.com">JQuery Mobile</a>, uma versão do JQuery para facilitar o desenvolvimento de interfaces web para smartphones...]]></description>
				<content:encoded><![CDATA[<p>No ano passado fiz a aquisição de um <a href="http://www.sonyericsson.com/cws/products/2.371/xperiax10">Xperia X10</a>, excelente smartphone com Android. Como sou bem curioso, mexi em tudo que podia. Peguei root, fiz o upgrade para o <a href="http://forum.xda-developers.com/showthread.php?t=911364">Android Gingerbread</a> e até <a href="http://thetwistedcables.com/android/how-to-start-android-development-a-startup-guide-for-workspace-installation/">instalei o ambiente de desenvolvimento de aplicativos</a>. </p>
<p>Fiz os testes com o JQuery Mobile e constatei que apesar de ainda estar em versão alpha já dá para brincar bastante. Nesse post  vou mostrar como fazer algumas telas simples para começarmos a entender como o JQm (JQuery Mobile) funciona.</p>
<p>Algumas pessoas já me perguntaram, como eu faço um site para iPhone, Android, Blackberry e outros smartphones? o JQuery Mobile pode de ajudar (e muito!) a fazer isso.</p>
<p>Para utilizar o JQuery mobile você precisa incluir três coisas no seu HTML:</p>
<ul>
<li><strong>Script do JQuery</strong> (O mesmo usamos nos outros posts) &#8211; <a href="http://code.jquery.com/jquery-1.5.min.js">http://code.jquery.com/jquery-1.5.min.js</a></li>
<li><strong>Script do JQuery Mobile</strong> (onde estão os métodos específicos para mobile) &#8211; <a href="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.js">http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.js</a></li>
<li><strong>CSS da interface do usuário (UI) para JQuery Mobile</strong> &#8211; <a href="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.css">http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.css</a></li>
</ul>
<p>Você pode baixar um arquivo compactado com o JS, o CSS com as imagens da UI da versão mobile <a href="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.zip">clicando aqui</a> e depois é só baixar o JQuery 1.5 <a href="http://code.jquery.com/jquery-1.5.1.min.js">aqui</a></p>
<p>Vamos ao primeiro exemplo de um <strong>index.html</strong>:</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
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #00bbdd;">&lt;!DOCTYPE html&gt;</span> 
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;html<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;head<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Primeira Página<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;script</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;http://code.jquery.com/jquery-1.5.min.js&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;script</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.js&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.css&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/head<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">data-role</span>=<span style="color: #ff0000;">&quot;page&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">data-role</span>=<span style="color: #ff0000;">&quot;header&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Primeira página<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">data-role</span>=<span style="color: #ff0000;">&quot;content&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>	
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Essa é sua primeira página para dispositivos móveis<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/html<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p><a href="/mobile/exemplo1/" target="_blank">Para ver o exemplo funcionando clique aqui.</a></p>
<p>Você deve estar se perguntando, mas que atributo <strong>data-role</strong> é esse?<br />
A partir do HTML5 você pode colocar metadados nas suas tags usando o <strong>data-*</strong><br />
Está disponivel nesse <a href="http://www.mauriciofaustino.com/2011/03/html5-e-o-atributo-data/">outro post</a> informações sobre esse assunto&#8230;</p>
<p>Então a essência do JQuery Mobile é basicamente essa, utilizar o atributo <strong>data-*</strong> para as diferentes funcionalidades e aparências.</p>
<p>Alguns atributos data-* que podem ser utilizados nas diferentes tags:</p>
<ul>
<li>data-role</li>
<li>data-theme</li>
<li>data-icon</li>
<li>data-transition</li>
</ul>
<p>Esse post foi apenas para apresentar esse novo recurso que a comunidade desenvolvedora do JQuery está preparando, espero fazer posts mais aprofundados sobre esse assunto em breve.</p>
<p>Lembre-se que o JQuery Mobile ainda está em versão <strong>alpha</strong>, ainda não é uma boa idéia usa-lo em produção</p>
<p>Caso tenha interesse de ver meus testes, acesse por seu celular endereço:</p>
<p><a href="http://www.mauriciofaustino.com/mobile/" target="_blank">http://www.mauriciofaustino.com/mobile/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mauriciofaustino.com/2011/03/conhecendo-jquery-mobile/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>HTML5 e o atributo data-*</title>
		<link>http://www.mauriciofaustino.com/2011/03/html5-e-o-atributo-data/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=html5-e-o-atributo-data</link>
		<comments>http://www.mauriciofaustino.com/2011/03/html5-e-o-atributo-data/#comments</comments>
		<pubDate>Fri, 25 Mar 2011 00:53:28 +0000</pubDate>
		<dc:creator>Maurício Faustino</dc:creator>
				<category><![CDATA[HTML5]]></category>

		<guid isPermaLink="false">http://www.mauriciofaustino.com/?p=211</guid>
		<description><![CDATA[Como todos já sabem o HTML5 será a próxima geração do HTML. Tivemos grandes mudanças (facilitadoras) do HTML4 para o XHTML e agora com a chegada do HTML5 a tendência é só melhorar. Apesar de ele ser novo, os browsers mais modernos já estão com suporte ao HTML5. Algumas das promessas do HTML5 são: Reduzir [...]]]></description>
				<content:encoded><![CDATA[<p>Como todos já sabem o HTML5 será a próxima geração do HTML. Tivemos grandes mudanças (facilitadoras) do HTML4 para o XHTML e agora com a chegada do HTML5 a tendência é só melhorar. Apesar de ele ser novo, os browsers mais modernos já estão com suporte ao HTML5.</p>
<p>Algumas das promessas do HTML5 são:</p>
<ul>
<li>Reduzir a necessidade de plugins externos (como o Flash)</li>
<li>Melhor manipulação de erro</li>
<li>Mais marcação para substituir o script</li>
<li>HTML5 deve ser independente do dispositivo</li>
</ul>
<p>No tópico <strong>Mais marcação para substituir o script</strong> encontrei um atributo muito interessante, o <strong>data-*</strong> que serve para adicionar metadados na sua tag.</p>
<p>Ou seja o data-* permite definirmos nossos próprios atributos da tag&#8230;</p>
<p>Por exemplo, se estivéssemos desenvolvendo um HTML para a página de comentários de uma foto (como nos sites de relacionamento) seria perfeitamente válido fazer algo desse tipo:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;li</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;comentario&quot;</span> <span style="color: #000066;">data-nome</span>=<span style="color: #ff0000;">&quot;Maurício Faustino&quot;</span> </span>
<span style="color: #009900;"><span style="color: #000066;">data-cidade</span>=<span style="color: #ff0000;">&quot;Brasília&quot;</span> <span style="color: #000066;">data-estado</span>=<span style="color: #ff0000;">&quot;DF&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">data-pais</span>=<span style="color: #ff0000;">&quot;Brasil&quot;</span> <span style="color: #000066;">data-lang</span>=<span style="color: #ff0000;">&quot;pt-br&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;b<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Maurício Faustino disse:<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/b<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;span<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Muito bonita essa foto!<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/li<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Nesse código criamos nossos atributos de metadados do comentário, como o nome, cidade, estado, país e língua em que o autor postou a mensagem.</p>
<p>A vantagem disso é que além do código ficar mais limpo e intuitivo podemos utilizar esses atributos tanto no CSS quanto no Java Script.</p>
<p>Se nós quisermos colorir cada comentário com as cores do país do autor basta fazer isso:</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="css" style="font-family:monospace;"><span style="color: #6666ff;">.comentario</span> <span style="color: #00AA00;">&#91;</span>data-pais<span style="color: #00AA00;">=</span>Brasil<span style="color: #00AA00;">&#93;</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">yellow</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #993333;">green</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.comentario</span> <span style="color: #00AA00;">&#91;</span>data-pais<span style="color: #00AA00;">=</span>Japao<span style="color: #00AA00;">&#93;</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">red</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #993333;">white</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
...</pre></td></tr></table></div>

<p>O que antes era feito enchendo as tags de classes, agora é possível utilizando a tag <strong>data-*</strong></p>
<p>Outra aplicação é no javascript, temos acesso a esses atributos, podendo inclusive altera-los.</p>
<p>No JQuery, utilizamos a função <strong>$(elemento).data()</strong> para usar e modificar esse atributo.<br />
Assim podemos fazer algo do tipo:</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><span style="color: #3366CC;">&quot;.comentario&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #000066; 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: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<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;">data</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;pais&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #3366CC;">&quot;Brasil&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		alert<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Comentário de um Brasileiro&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Assim podemos ver que o HTML5 veio para ajudar e facilitar!</p>
<p>Fique a vontade para fazer comentários, críticas e sugestões sobre o post&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mauriciofaustino.com/2011/03/html5-e-o-atributo-data/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Metodo .live() no JQuery</title>
		<link>http://www.mauriciofaustino.com/2010/03/metodo-live-no-jquery/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=metodo-live-no-jquery</link>
		<comments>http://www.mauriciofaustino.com/2010/03/metodo-live-no-jquery/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 17:07:53 +0000</pubDate>
		<dc:creator>Maurício Faustino</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[live]]></category>
		<category><![CDATA[novidades]]></category>

		<guid isPermaLink="false">http://www.mauriciofaustino.com/?p=159</guid>
		<description><![CDATA[Dia 28 de janeiro de 2010 foi oficialmente lançado a versão 1.4 do JQuery. Essa versão veio com algumas novidades muito interessantes. Dediquei esse post para mostrar uma das inovações dessa versão.]]></description>
				<content:encoded><![CDATA[<p>Por falta de tempo fiquei um tempo sem postar no blog, mas agora vou tentar voltar a dedicar um tempo para novos posts.</p>
<p>Dia 28 de janeiro de 2010 foi oficialmente lançado a versão 1.4 do JQuery. Essa versão veio com algumas novidades muito interessantes. Dediquei esse post para mostrar uma das inovações dessa versão.</p>
<p>Para quem usa AJAX com JQuery a algum tempo, deve conhecer o plugin <strong>Livequery</strong>.<br />
Esse plugin permite que o desenvolvedor faça um <strong>.bind()</strong> em um evento de um elemento, e o bind permaneça mesmo se o DOM for atualizado.</p>
<p>No JQuery 1.4 foi implementado o metodo <strong>.live()</strong> o que faz com que agente não precise mais do plugin.</p>
<p>Um exemplo:</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="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;exemplosBind&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h3<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Exemplos Bind<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h3<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;botaoBind&quot;</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;#&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Botao usando metodo Bind<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;hr</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;exemplosLive&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h3<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Exemplos Live<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h3<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;botaoLive&quot;</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;#&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Botao usando metodo Live<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>em nosso javascript:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #000066; 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;.botaoBind&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;click&quot;</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		novoBotao <span style="color: #339933;">=</span> $<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;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">clone</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.exemplosBind&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span>novoBotao<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: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.botaoLive&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">live</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;click&quot;</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		novoBotao <span style="color: #339933;">=</span> $<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;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">clone</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.exemplosLive&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span>novoBotao<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: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>No <strong>Exemplos Bind</strong>, o primeiro botão tem o evento, mas os outros botões criados por ele não tem o evento.<br />
Já no <strong>Exemplos Live</strong>, todos os botões (inclusive os inseridos dinamicamentes no DOM) estão com o evento.</p>
<p>Isso é muito util tambem para quando estamos trabalhando com Ajax.</p>
<p><a title="veja aqui o exemplo" href="http://www.mauriciofaustino.com/exemplos/bind e live/" target="blank">Você pode ver esse código funcionando clicando aqui.</a></p>
<p>Para ver outras novidades do JQuery 1.4 veja esses posts:</p>
<ul>
<li><a href="http://techlive.org/jquery/novidades-do-jquery-1-4-1-a-nova-maneira-de-criar-elementos/" target="_blank">A nova maneira de criar elementos</a></li>
<li><a href="http://techlive.org/jquery/novidades-do-jquery-1-4-%E2%80%93-2-ligando-multiplos-eventos-a-um-elemento/" target="_blank">Ligando múltiplos eventos a um elemento</a></li>
<li><a href="http://techlive.org/jquery/novidades-do-jquery-1-4-%E2%80%93-3-eventos-focusin-e-focusout/" target="_blank">Eventos focusin e focusout</a></li>
<li><a href="http://techlive.org/jquery/novidades-do-jquery-1-4-%E2%80%93-4-atrasos-nas-animacoes-com-a-funcao-delay/" target="_blank">Atrasos nas animações com a função delay()</a></li>
<li><a href="http://techlive.org/jquery/novidades-do-jquery-1-4-%E2%80%93-5-recortando-um-elemento-da-dom-com-detach/" target="_blank">Recortando” um elemento da DOM com detach()</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.mauriciofaustino.com/2010/03/metodo-live-no-jquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cálculo</title>
		<link>http://www.mauriciofaustino.com/2009/04/calculo/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=calculo</link>
		<comments>http://www.mauriciofaustino.com/2009/04/calculo/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 00:31:56 +0000</pubDate>
		<dc:creator>Maurício Faustino</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Trabalhos]]></category>
		<category><![CDATA[trabalho]]></category>

		<guid isPermaLink="false">http://www.mauriciofaustino.com/?p=108</guid>
		<description><![CDATA[Como alguns de vocês já devem saber, eu faço faculdade de ciência da computação no UniCEUB.  E tive a oportunidade de fazer alguns trabalhos interessantes, resolvi postar alguns deles aqui no blog.

Um muito legal que tive que fazer foi da disciplina de Cálculo II onde o desafio era elaborar um programa que calculasse a integral definida usando a definição (e não usando o Teorema Fundamental do Cálculo)  usando um refinamento que o usuário pode controlar dizendo em quantas partes quer dividir o intervalo de integração [a,b]...]]></description>
				<content:encoded><![CDATA[<p>Como alguns de vocês já devem saber, eu faço faculdade de ciência da computação no UniCEUB.  E tive a oportunidade de fazer alguns trabalhos interessantes, resolvi postar alguns deles aqui no blog.</p>
<p>Um muito legal que tive que fazer foi da disciplina de Cálculo II onde o desafio era elaborar um programa que calculasse a integral definida usando a definição (e não usando o Teorema Fundamental do Cálculo)  usando um refinamento que o usuário pode controlar dizendo em quantas partes quer dividir o intervalo de integração [a,b]</p>
<p>Como sempre resolvi ir um pouco alem do desafio, fiz um programa que calcula a integral aproximada junto com o esboço do gráfico de várias funções, e resolvi esse problema usando apenas recursos de XHTML e JQuery.</p>
<p>Você deve estar pensando&#8230; &#8220;Ele usou algum recurso para gerar imagens com javascript&#8221;. Mas por incrivel que pareça não usei nada desse tipo. Fiz o gráfico apenas com CSS e DIVS.</p>
<p style="text-align: center;">
<p style="text-align: center;"><a href="http://www.mauriciofaustino.com/exemplos/calculo/" target="_blank"><a href="http://www.mauriciofaustino.com/exemplos/calculo/" rel="attachment wp-att-313"><img class="size-full wp-image-313 aligncenter" alt="untitled-1" src="http://www.mauriciofaustino.com/wp-content/uploads/2009/04/untitled-1.gif" width="189" height="153" /></a>Clique aqui para ver a aplicação.</a></p>
<p>Caso alguem se interesse pelo código, ou se tiver alguma pergunta deixem comentários ou e-mails. Responderei assim que possível.</p>
<p>Queria mandar meus agradecimentos aos amigos Marcello Brandão, Maurício Madalozzo e ao professor Luís Cláudio que me ajudaram nesse projeto.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mauriciofaustino.com/2009/04/calculo/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Adicionar Campos Dinâmicos</title>
		<link>http://www.mauriciofaustino.com/2009/04/adicionar-campos-dinamicos/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=adicionar-campos-dinamicos</link>
		<comments>http://www.mauriciofaustino.com/2009/04/adicionar-campos-dinamicos/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 17:33:02 +0000</pubDate>
		<dc:creator>Maurício Faustino</dc:creator>
				<category><![CDATA[Destaque]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.mauriciofaustino.com/?p=96</guid>
		<description><![CDATA[Um componente muito util para formulários é você poder adicionar campos dinâmicamente em seu formulário, por exemplo... Em um formulário de cadastro de uma pessoa, você precisa que ele preencha o formulário com todos os telefones dela.

Mas você não sabe quantos telefones essa pessoa tem. Então precisamos que ela possa adicionar campos nesse formulário, vou mostrar uma forma bem fácil de você resolver esse problema usando novamente a biblioteca JQuery.

No nosso index.html faremos nosso formulário...]]></description>
				<content:encoded><![CDATA[<p>Um componente muito util para formulários é você poder adicionar campos dinâmicamente em seu formulário, por exemplo&#8230; Em um formulário de cadastro de uma pessoa, você precisa que ele preencha o formulário com todos os telefones dela.</p>
<p>Mas você não sabe quantos telefones essa pessoa tem. Então precisamos que ela possa adicionar campos nesse formulário, vou mostrar uma forma bem fácil de você resolver esse problema usando novamente a biblioteca JQuery.</p>
<p>No nosso <strong>index.html</strong> faremos nosso formulário&#8230;</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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;">&lt; !DOCTYPE html PUBLIC <span style="color: #ff0000;">&quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;</span></span>
<span style="color: #009900;">	        <span style="color: #ff0000;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;html</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span> <span style="color: #000066;">xml:lang</span>=<span style="color: #ff0000;">&quot;en&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;head<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;meta</span> <span style="color: #000066;">http-equiv</span>=<span style="color: #ff0000;">&quot;content-type&quot;</span> <span style="color: #000066;">content</span>=<span style="color: #ff0000;">&quot;text/html; charset=utf-8&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Exemplo<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;script</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;jquery.js&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;script</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;aplicacao.js&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/head<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;border:1px solid #CCC; background-color:#EFEFEF; padding:0 20px;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Exemplo Campos Din<span style="color: #ddbb00;">&amp;acirc;</span>micos<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Esse arquivo <span style="color: #ddbb00;">&amp;eacute;</span> parte de um arquivo feito por Maur<span style="color: #ddbb00;">&amp;iacute;</span>cio Faustino para mostrar como um formul<span style="color: #ddbb00;">&amp;aacute;</span>rio com campos din<span style="color: #ddbb00;">&amp;acirc;</span>micos<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;width:500px; margin:auto;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;form</span> <span style="color: #000066;">action</span>=<span style="color: #ff0000;">&quot;mantemPessoas.php&quot;</span> <span style="color: #000066;">method</span>=<span style="color: #ff0000;">&quot;post&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fieldset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;legend<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Dados Pessoais<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/legend<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;label</span> <span style="color: #000066;">for</span>=<span style="color: #ff0000;">&quot;nome&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Nome da Pessoa<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;input</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;nome&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;nome&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;label</span> <span style="color: #000066;">for</span>=<span style="color: #ff0000;">&quot;dataNascimento&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Data de Nascimento<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;input</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;dataNascimento&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;dataNascimento&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fieldset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fieldset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;legend<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Telefones<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/legend<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;telefones&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;campoTelefone&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;input</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;telefone[]&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;removerCampo&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Remover Campo<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;adicionarCampo&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Adicionar Telefone<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fieldset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/form<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;http://www.mauriciofaustino.com/2009/04/adicionar-campos-dinamicos/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Voltar para o post.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/html<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Lembrando que você precisa ter o arquivo da biblioteca jquery na mesma pasta do seu index.</p>
<p>O nosso <strong>aplicacao.js</strong> ficaria assim:</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
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #000066; 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: #000066; font-weight: bold;">function</span> removeCampo<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;.removerCampo&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">unbind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;click&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.removerCampo&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;click&quot;</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
			$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.telefones p.campoTelefone&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				i<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: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>i<span style="color: #339933;">&gt;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				$<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;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	removeCampo<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.adicionarCampo&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		novoCampo <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.telefones p.campoTelefone:first&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">clone</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		novoCampo.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</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>
		novoCampo.<span style="color: #660066;">insertAfter</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.telefones p.campoTelefone:last&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		removeCampo<span style="color: #009900;">&#40;</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>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Vamos explicar o que foi feito:</p>
<p><strong>Linha 1 -</strong> Define o código JQuery que será rodado no carregamento da página.</p>
<p><strong>Linha 2 -</strong> Declara uma função chamada removeCampo.</p>
<p><strong>Linha 3 -</strong> Tira qualquer função que esteja setada para ser executada quando o elemento com a classe removerCampo seja clicado.</p>
<p><strong>Linha 4 -</strong> Quando um elemento com a classe removerCampo for clicado executará a seguinte função.</p>
<p><strong>Linha 5 -</strong> Teclara uma variavel <strong>i</strong> igual a zero.</p>
<p><strong>Linha 6 -</strong> Para cada <strong>p</strong> com a classe campo telefone dentro de um elemento com a class telefones executará a seguinte função.</p>
<p><strong>Linha 7 -</strong> Incrementa a variavel <strong>i</strong> (a linha 5 e 6 servem para contar quantos p.campoTelefone existem dentro do elemento com a classe telefones).</p>
<p><strong>Linha 9 -</strong> Se <strong>i</strong> for maior que 1 (se esse não for o unico elemento dentro da div telefones.</p>
<p><strong>Linha 10 -</strong> Remove o pai do link clicado, ou seja, o <strong>p.campoTelefone</strong>.</p>
<p><strong>Linha 14 &#8211; </strong>Executa a função <strong>removeCampo()</strong>.</p>
<p><strong>Linha 15 -</strong> Quando um elemento com a classe <strong>adicionarCampo</strong> for clicado.</p>
<p><strong>Linha 16 &#8211; </strong>Clona o primeiro <strong>p</strong> com a classe <strong>campoTelefone</strong> e insere em uma variável que chamei de <strong>novoCampo</strong><strong>.</p>
<p></strong><strong>Linha 17 -</strong> Procura dentro do elemento <strong>novoCampo</strong> um <strong>input</strong><strong> e seta o </strong><strong>value</strong> dele como vazio.</p>
<p><strong>Linha 18 -</strong> Insere o elemento <strong>novoCampo</strong> depois do ultimo <strong>p</strong> com a classe <strong>campoTelefone</strong>.</p>
<p><strong>Linha 19 -</strong> Executa a função <strong>removeCampo</strong>.</p>
<p>E está feito nosso componente de adicionar campos de telefone dinamicamente. Se você não entendeu porque eu tieve que executar a função removeCampo duas vezes, leia o artigo <a href="http://www.mauriciofaustino.com/2009/03/ajax-primeiros-problemasajax-primeiros-problemas/" target="_blank">AJAX &#8211; Primeiros Problemas</a> onde tem uma explicação melhor sobre esse assunto.</p>
<p>Estive recebendo muitas dúvidas dos visitantes do blog sobre como pegar os telefones no arquivo PHP que vai receber as informações desse formulário&#8230;</p>
<p>Segue um exemplo simples para pegar o resultado:</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="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$telefone</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'telefone'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$quantidade</span> <span style="color: #339933;">=</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$telefone</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">&lt;</span><span style="color: #000088;">$quantidade</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">echo</span>  <span style="color: #0000ff;">&quot;Telefone: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$telefone</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Explicando&#8230;</p>
<p><strong>Linha 2 -</strong> Pega as informações que foram passadas via POST pelo formulario. (no caso do PHP, ele ja identifica o [] no atributo name do input e identifica como um array)</p>
<p><strong>Linha 3 -</strong> Pega a quantidade de telefones que tem no array.</p>
<p><strong>Linha 4 -</strong> Faz um laço para varrer todo o array de telefones.</p>
<p><strong>Linha 5 -</strong> Mostra cada telefone.</p>
<p>Quando esse formulário for submetido você receberá em seu PHP um array de telefones.</p>
<p>Gostaram?</p>
<p><strong>Você pode ver esse exemplo funcionando clicando <a href="http://www.mauriciofaustino.com/exemplos/campos%20dinamicos/" target="_blank">aqui</a></strong>.</p>
<p><strong></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mauriciofaustino.com/2009/04/adicionar-campos-dinamicos/feed/</wfw:commentRss>
		<slash:comments>135</slash:comments>
		</item>
		<item>
		<title>AJAX &#8211; Primeiros Problemas</title>
		<link>http://www.mauriciofaustino.com/2009/03/ajax-primeiros-problemas/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ajax-primeiros-problemas</link>
		<comments>http://www.mauriciofaustino.com/2009/03/ajax-primeiros-problemas/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 19:59:59 +0000</pubDate>
		<dc:creator>Maurício Faustino</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.mauriciofaustino.com/?p=85</guid>
		<description><![CDATA[Um dos primeiros problemas que assombram os desenvolvedores iniciantes no AJAX é quando a página requisitada traz um elementos que tinham eventos definidos anteriormente...

Vamos exemplificar, vamos fazer um index.html com o seguinte código...]]></description>
				<content:encoded><![CDATA[<p>Um dos primeiros problemas que assombram os desenvolvedores iniciantes no AJAX é quando a página requisitada traz um elementos que tinham eventos definidos anteriormente&#8230;</p>
<p>Vamos exemplificar, vamos fazer um <strong>index.html</strong> com o seguinte código:</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
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;html</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span> <span style="color: #000066;">xml:lang</span>=<span style="color: #ff0000;">&quot;en&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;head<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;meta</span> <span style="color: #000066;">http-equiv</span>=<span style="color: #ff0000;">&quot;content-type&quot;</span> <span style="color: #000066;">content</span>=<span style="color: #ff0000;">&quot;text/html; charset=utf-8&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Exemplo<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;script</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;script</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;aplicacao.js&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/head<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;menu&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ul<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;li<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;pagina1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Pagina 1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/li<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;li<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;pagina2&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Pagina 2<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/li<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ul<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;conteudo&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Essa <span style="color: #ddbb00;">&amp;eacute;</span> uma pagina com um <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;link&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>link<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/html<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Agora temos uma página html simples, vamos para o javascript, novamente usando a biblioteca JQuery.</p>
<p>vamos criar o arquivo <strong>aplicacao.js</strong> com o seguinte código:</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
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #000066; 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;#pagina1&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #000066; 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;#conteudo&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">load</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;conteudos.html #conteudo1&quot;</span><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;">&#40;</span><span style="color: #3366CC;">&quot;#pagina2&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #000066; 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;#conteudo&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">load</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;conteudos.html #conteudo2&quot;</span><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;">&#40;</span><span style="color: #3366CC;">&quot;#link&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		alert<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Você clicou no link&quot;</span><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><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Vamos explicar as linhas:</p>
<p><strong>Linha 1 -</strong> Define o código JQuery que será rodado no carregamento da página.</p>
<p><strong>Linha 2 -</strong> Quando o elemento com id <strong>pagina1</strong> for clicado executará uma função.</p>
<p><strong>Linha 3 -</strong> Carrega o conteudo do elemento com id <strong>conteudo1</strong> do arquivo <strong>conteudos.html </strong>(ainda vamos criar esse arquivo) para dentro do elemento com id <strong>conteudo</strong>.</p>
<p><strong>Linha 4 &#8211; </strong>retorna falso, para o fluxo padrão do html para links não ser executado.</p>
<p><strong>Linha 6 -</strong> Quando o elemento com id <strong>pagina2</strong> for clicado executará uma função.</p>
<p><strong>Linha 7 -</strong> Carrega o conteudo do elemento com id <strong>conteudo2</strong> do arquivo <strong>conteudos.html </strong>(ainda vamos criar esse arquivo) para dentro do elemento com id <strong>conteudo</strong>.</p>
<p><strong>Linha 8 &#8211; </strong>retorna falso, para o fluxo padrão do html para links não ser executado.</p>
<p><strong>Linha 10 &#8211; </strong>Quando o elemento com id <strong>link </strong>for clicado executará uma função.</p>
<p><strong>Linha 11 &#8211; </strong>Alerta o usuário que ele clicou no link.</p>
<p><strong>Linha 12 &#8211; </strong>retorna falso, para o fluxo padrão do html para links não ser executado.</p>
<p>Criando o arquivo <strong>conteudos.html:</strong></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
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;">&lt; !DOCTYPE html PUBLIC <span style="color: #ff0000;">&quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;</span></span>
<span style="color: #009900;">			<span style="color: #ff0000;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;html</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span> <span style="color: #000066;">xml:lang</span>=<span style="color: #ff0000;">&quot;en&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;head<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;meta</span> <span style="color: #000066;">http-equiv</span>=<span style="color: #ff0000;">&quot;content-type&quot;</span> <span style="color: #000066;">content</span>=<span style="color: #ff0000;">&quot;text/html; charset=utf-8&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Exemplo<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/head<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;conteudo1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Esse <span style="color: #ddbb00;">&amp;eacute;</span> o conteudo da primeira pagina<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Essa tambem <span style="color: #ddbb00;">&amp;eacute;</span> uma pagina com um <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;link&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>link<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;conteudo2&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Esse <span style="color: #ddbb00;">&amp;eacute;</span> o conteudo da segunda pagina<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Essa tambem <span style="color: #ddbb00;">&amp;eacute;</span> uma pagina com um <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;link&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>link<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/html<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Pronto, está feito nosso AJAX que carrega conteudos. Mas ainda tem um problema, os links que foram carregados através do AJAX não devem estar funcionando.</p>
<p>Isso acontece porque a linha 10 do nosso <strong>aplicacao.js</strong> foi executada quando a página foi carregada, ou seja, o evento só foi adicionado para os elementos DOM que estavam no documento naquele momento, o que veio depois, não sofreu alteração.</p>
<p>Uma forma de resolver isso é executar novamente a chamada pro evento da seguinte forma:</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
25
26
27
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #000066; 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;#pagina1&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #000066; 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;#conteudo&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">load</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;conteudos.html #conteudo1&quot;</span><span style="color: #339933;">,</span> <span style="color: #000066; 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;#link&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">unbind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;click&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#link&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;click&quot;</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				alert<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Voc&amp;ecirc; clicou no link&quot;</span><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><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;">&#40;</span><span style="color: #3366CC;">&quot;#pagina2&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #000066; 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;#conteudo&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">load</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;conteudos.html #conteudo2&quot;</span><span style="color: #339933;">,</span> <span style="color: #000066; 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;#link&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">unbind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;click&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#link&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;click&quot;</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				alert<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Voc&amp;ecirc; clicou no link&quot;</span><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><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;">&#40;</span><span style="color: #3366CC;">&quot;#link&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		alert<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Voc&amp;ecirc; clicou no link&quot;</span><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>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Substituindo esse código no <strong>aplicacao.js</strong> resolveremos esse poblema, o que eu fiz foi setar uma função para ser executada depois que o ajax for concluído, ou seja, quando o nosso novo elemento esteja no DOM.</p>
<p>Eu usei unbind e depois bind para caso o link estivesse em outro lugar da pagina que não seja onde o ajax carregou o evento nao seja adicionado duas vezes, o que faria com que nossa função seja executada duas vezes resultando em 2 alerts.</p>
<p>Outra forma de resolver isso seria usando o plugin livequery, mas esse tutorial vou deixar para um próximo post.</p>
<p><strong>Você pode ver um exemplo funcionando <a href="http://www.mauriciofaustino.com/exemplos/ajax%20-%20primeiros%20problemas/" target="_blank">aqui</a>.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mauriciofaustino.com/2009/03/ajax-primeiros-problemas/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>O que é Creative Commons?</title>
		<link>http://www.mauriciofaustino.com/2009/03/o-que-e-creative-commons/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=o-que-e-creative-commons</link>
		<comments>http://www.mauriciofaustino.com/2009/03/o-que-e-creative-commons/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 12:04:55 +0000</pubDate>
		<dc:creator>Maurício Faustino</dc:creator>
				<category><![CDATA[Bloggando]]></category>
		<category><![CDATA[commons]]></category>
		<category><![CDATA[copyright]]></category>
		<category><![CDATA[creative]]></category>
		<category><![CDATA[direitos]]></category>
		<category><![CDATA[reservados]]></category>

		<guid isPermaLink="false">http://www.mauriciofaustino.com/?p=77</guid>
		<description><![CDATA[Vocês já devem ter notado alguns links para a página do <a href="http://pt.wikipedia.org/wiki/Creative_Commons" target="_blank">Creative Commons</a> distribuidas pelo blog, alguns de vocês devem estar se perguntando o que é isso...

Creative Commons são tipos de licenças idealizadas para permitir a padronização de declarações de vontade no tocante ao licenciamento e...]]></description>
				<content:encoded><![CDATA[<p>Vocês já devem ter notado alguns links para a página do <a href="http://www.creativecommons.org.br" target="_blank">Creative Commons</a> distribuidas pelo blog, alguns de vocês devem estar se perguntando o que é isso&#8230;</p>
<p>Creative Commons são tipos de licenças idealizadas para permitir a padronização de declarações de vontade no tocante ao licenciamento e distribuição de conteúdos culturais em geral (textos, músicas, imagens, filmes e outros), de modo a facilitar seu compartilhamento e recombinação.</p>
<p>Ou seja, apartir do momento que eu disse que os artigos do meu blog são licenciados pela Creative Commons você pode copiar, distribuir, complementar ou executar as obras sobre algumas restrições. No caso do meu blog você pode fazer essas coisas desde que mantenha o crédito ao autor e que não seja para uso comercial.</p>
<p>O primeiro contato que tive com o Creative Commons foi em 2007, em um evento Open Source que participei em Curitiba. Eu achei uma ideia genial pois incentiva o compartilhamento e colaboração simultânea para a melhoria de uma obra, sem ficarmos presos nas limitações do <a href="http://pt.wikipedia.org/wiki/Copyright" target="_blank">copyright</a>.</p>
<p>O vídeo abaixo explica melhor como funciona essa idéia&#8230;</p>
<div style="margin: auto; width: 425px;"><object width="425" height="344" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/izSOrOmxRgE&amp;hl=pt-br&amp;fs=1" /><param name="allowfullscreen" value="true" /><embed width="425" height="344" type="application/x-shockwave-flash" src="http://www.youtube.com/v/izSOrOmxRgE&amp;hl=pt-br&amp;fs=1" allowFullScreen="true" allowscriptaccess="always" allowfullscreen="true" /></object></div>
]]></content:encoded>
			<wfw:commentRss>http://www.mauriciofaustino.com/2009/03/o-que-e-creative-commons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
