<?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>Blog de sergio &#187; Ajax</title>
	<atom:link href="http://www.serunix.com/category/ajax/feed" rel="self" type="application/rss+xml" />
	<link>http://www.serunix.com</link>
	<description>&#34;Un informático que sólo quiere ayudar... &#34;</description>
	<lastBuildDate>Sun, 04 Sep 2011 19:34:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>internet explorer no acepta tipo de objetos de javascript  que terminen con un coma &#8220;,&#8221;&#8230;</title>
		<link>http://www.serunix.com/2009/05/29/internet-explorer-no-acepta-tipo-de-objetos-de-javascript-que-terminen-con-un-coma</link>
		<comments>http://www.serunix.com/2009/05/29/internet-explorer-no-acepta-tipo-de-objetos-de-javascript-que-terminen-con-un-coma#comments</comments>
		<pubDate>Fri, 29 May 2009 16:30:20 +0000</pubDate>
		<dc:creator>sergio</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Programación]]></category>

		<guid isPermaLink="false">http://www.serunix.com/?p=369</guid>
		<description><![CDATA[al crear un tipo de objeto javascript como por ejemplo: 1 2 3 4 5 6 7 8 9 10 11 12 var ajaxLogin = &#123; content: &#123;&#34;login&#34;:dojo.byId&#40;&#34;login&#34;&#41;.value&#125;, url: &#34;UR_SEND&#34;, handleAs: &#34;text&#34;, load: function&#40;response&#41;&#123; responseNode.innerHTML = response; &#125;, error: function&#40;response&#41;&#123; responseNode.innerHTML = &#34;error&#34;; &#125;, timeout: 10000, &#125;; Donde el el ultimo atributo &#8220;timeout&#8221; termina con [...]]]></description>
			<content:encoded><![CDATA[<p>al crear un tipo de objeto javascript como por ejemplo:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"> <span style="color: #003366; font-weight: bold;">var</span> ajaxLogin <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
         content<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;login&quot;</span><span style="color: #339933;">:</span>dojo.<span style="color: #660066;">byId</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;login&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">value</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
         url<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;UR_SEND&quot;</span><span style="color: #339933;">,</span>
         handleAs<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;text&quot;</span><span style="color: #339933;">,</span>
         load<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>response<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		 responseNode.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> response<span style="color: #339933;">;</span>
	  <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
	 error<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>response<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	     	  responseNode.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;error&quot;</span><span style="color: #339933;">;</span>
	 <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
	 timeout<span style="color: #339933;">:</span> <span style="color: #CC0000;">10000</span><span style="color: #339933;">,</span>
   <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Donde el el ultimo atributo &#8220;timeout&#8221; termina con una &#8220;,&#8221;&#8230; en firefox funciona muy bien pero en Internet Explorer se tiene que quitar como por ejemplo:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"> <span style="color: #003366; font-weight: bold;">var</span> ajaxLogin <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
         content<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;login&quot;</span><span style="color: #339933;">:</span>dojo.<span style="color: #660066;">byId</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;login&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">value</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
         url<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;UR_SEND&quot;</span><span style="color: #339933;">,</span>
         handleAs<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;text&quot;</span><span style="color: #339933;">,</span>
         load<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>response<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		 responseNode.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> response<span style="color: #339933;">;</span>
	  <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
	 error<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>response<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	     	  responseNode.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;error&quot;</span><span style="color: #339933;">;</span>
	 <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
	 timeout<span style="color: #339933;">:</span> <span style="color: #CC0000;">10000</span>
   <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>listo&#8230; ya no marca un error el &#8220;navegador&#8221;&#8230;</p>
<div class="thanks_button_div" style="float: left; margin-right: 10px;"><div style="float: left; display: inline;"><input type="button" onclick="thankYouButtonClick(369, 'You left &ldquo;Thanks&rdquo; already for this post')" value="Thank You: 0"
                class="thanks_button thanks_custom_button "
                style="background-image:url(http://b.static.ak.fbcdn.net/rsrc.php/yp/r/qDH1xoDhFBF.gif);width:15px; height:13px; font-family: Verdana, Arial, Sans-Serif; font-size: 14px; font-weight: normal;; color:#ffffff;"
                id="thanksButton_369_2" title="Click to left &ldquo;Thanks&rdquo; for this post"/></div><div id="ajax_loader_369_2" style="display:inline;visibility: hidden;"><img alt="ajax loader" src="http://www.serunix.com/wp-content/plugins/thanks-you-counter-button/images/ajax-loader.gif" /></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.serunix.com/2009/05/29/internet-explorer-no-acepta-tipo-de-objetos-de-javascript-que-terminen-con-un-coma/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Como enviar campos de un formulario por medio de POST y utilizando Dojo (dojo.xhrPost)&#8230;</title>
		<link>http://www.serunix.com/2009/02/23/como-enviar-campos-de-un-formulario-por-medio-de-post-y-utilizando-dojo-dojoxhrpost%e2%80%a6</link>
		<comments>http://www.serunix.com/2009/02/23/como-enviar-campos-de-un-formulario-por-medio-de-post-y-utilizando-dojo-dojoxhrpost%e2%80%a6#comments</comments>
		<pubDate>Mon, 23 Feb 2009 08:46:31 +0000</pubDate>
		<dc:creator>sergio</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Programación]]></category>

		<guid isPermaLink="false">http://www.serunix.com/?p=215</guid>
		<description><![CDATA[Para poder enviar los valores de campos de un formulario por medio del método post es muy fácil prácticamente en cualquier lenguaje, pero si queremos que la página no se recargue y que el proceso sea trasparente para el usuario, podemos utilizar una librería muy buena y que está en constante evolución llamada DOJO. Con [...]]]></description>
			<content:encoded><![CDATA[<p>Para poder enviar los valores de campos de un formulario por medio del método post es muy fácil prácticamente en cualquier lenguaje, pero si queremos que la página no se recargue y que el proceso sea trasparente para el usuario, podemos utilizar una librería muy buena y que está en constante evolución llamada <a href="http://www.dojotoolkit.org/">DOJO</a>.</p>
<p>Con sólo declarar en la cabecera de nuestra página la librería siguiente:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://ajax.googleapis.com/ajax/libs/dojo/1.2/dojo/dojo.xd.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Y el siguiente método es el que yo utilizó:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> responseId <span style="color: #339933;">=</span> dojo.<span style="color: #660066;">byId</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Message&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
 <span style="color: #003366; font-weight: bold;">var</span> argsSend <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #006600; font-style: italic;">// se pueden  enviar solo algunos datos</span>
        <span style="color: #006600; font-style: italic;">// content: {&quot;Nombre&quot;:dojo.byId(&quot;id del campo&quot;).value},</span>
         <span style="color: #006600; font-style: italic;">// o todo el formulario</span>
         form<span style="color: #339933;">:</span> <span style="color: #3366CC;">'nombre del form'</span><span style="color: #339933;">,</span>
         url<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;a donde van los valores&quot;</span><span style="color: #339933;">,</span>
          handleAs<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;text&quot;</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">// muy importante: es el tipo de respuesta que se va a recibir</span>
          load<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>response<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 		 responseId.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> response<span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
          error<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>response<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	         responseId.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;ERROR&quot;</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
          timeout<span style="color: #339933;">:</span> <span style="color: #CC0000;">500</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
dojo.<span style="color: #660066;">xhrPost</span><span style="color: #009900;">&#40;</span>argsSend<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<div class="thanks_button_div" style="float: left; margin-right: 10px;"><div style="float: left; display: inline;"><input type="button" onclick="thankYouButtonClick(215, 'You left &ldquo;Thanks&rdquo; already for this post')" value="Thank You: 0"
                class="thanks_button thanks_custom_button "
                style="background-image:url(http://b.static.ak.fbcdn.net/rsrc.php/yp/r/qDH1xoDhFBF.gif);width:15px; height:13px; font-family: Verdana, Arial, Sans-Serif; font-size: 14px; font-weight: normal;; color:#ffffff;"
                id="thanksButton_215_2" title="Click to left &ldquo;Thanks&rdquo; for this post"/></div><div id="ajax_loader_215_2" style="display:inline;visibility: hidden;"><img alt="ajax loader" src="http://www.serunix.com/wp-content/plugins/thanks-you-counter-button/images/ajax-loader.gif" /></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.serunix.com/2009/02/23/como-enviar-campos-de-un-formulario-por-medio-de-post-y-utilizando-dojo-dojoxhrpost%e2%80%a6/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

