<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">

<channel>
<title>Blog bloc: Ajax</title>
<link>http://widea.zoomblog.com/</link>
<description>Blog sobre programaci&#243;n y dise&#241;o web de un programador en Sevilla</description>
<dc:language>es</dc:language>
<dc:date>2005-09-19T14:12:00+01:00</dc:date>
<lastBuildDate>Mon, 12 May 2008 08:13:41 GMT</lastBuildDate>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
<image>
<title>ZoomBlog</title>
<url>http://www.zoomblog.com/pics/blogs/ZoomBlog_mini.gif</url>
<link>http://www.zoomblog.com/</link>
</image>

<item>
 <title>Ajax y su ayudante Sarissa</title>
<link>http://widea.zoomblog.com/archivo/2005/09/19/ajax-y-su-ayudante-Sarissa.html</link>
 <guid isPermaLink="true">http://widea.zoomblog.com/archivo/2005/09/19/ajax-y-su-ayudante-Sarissa.html</guid>
 <description>
 <![CDATA[
<font size="1"><span style="font-family: verdana,arial,helvetica,sans-serif;">En mi art&#237;culo anterior os hablaba de <span style="font-weight: bold;">las prendas y virtudes de Ajax</span>, y me qued&#233; con la sensaci&#243;n de haberme quedado muy corto en mis explicaciones y en las implicaciones que conlleva este m&#233;todo (no lo llamar&#233; tecnolog&#237;a tal y como explica Jesse James Garrett en </span><a target="_blank" href="http://www.adaptivepath.com/publications/essays/archives/000385.php" style="font-family: verdana,arial,helvetica,sans-serif;">http://www.adaptivepath.com/publications/essays/archives/000385.php</a><span style="font-family: verdana,arial,helvetica,sans-serif;">.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">No obstante, ahora que ya tenemos m&#225;s o menos claro qu&#233; es Ajax, c&#243;mo se hace con javascript etc... Llega el <span style="font-weight: bold;">"momento API"!!!!!</span></span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">El momento API es el momento de perfeccionamiento de una t&#233;cnica o de cualquier tipo de programaci&#243;n. Es el momento en el que todo ese c&#243;digo diseminado, "scattered", forma un conjunto y se vuelve algo profesional.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Yo he optado por tomar prestado una API que hasta el momento ha atendido todas mis necesidades. Se trata de la API de Sarissa:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><a target="_blank" href="https://sourceforge.net/projects/sarissa/" style="font-family: verdana,arial,helvetica,sans-serif;">https://sourceforge.net/projects/sarissa/</a><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Es un proyecto "open source" con el que unificamos el uso de Ajax para diferentes navegadores, no s&#233; si Opera y otros, pero s&#237; para Mozilla e Internet Explorer, y KHTML(Konqueror y Safari).</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /></font><font size="2" style="font-family: verdana,arial,helvetica,sans-serif;"><span style="font-weight: bold;">APIs javascript</span></font><font size="1"><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Quien nunca haya utilizado una API de javascript, pensar&#225; una API de javascript? Ese lenguaje horrible que no puede </span><span style="font-family: verdana,arial,helvetica,sans-serif;">depurarse como los verdaderos lenguajes de programaci&#243;n?</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Eso no puede traer nada bueno!!</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Pues bien, se equivocan, por supuesto, javascript no es perfecto, pero conocer javascript para un programador web es </span><span style="font-family: verdana,arial,helvetica,sans-serif;">como el volante para un conductor, y sin javascript, no hay programador web. Suena obvio pero no es tanto as&#237;, porque </span><span style="font-family: verdana,arial,helvetica,sans-serif;">el programador web tiende a aferrarse al lenguaje de servidor y aunque en una gran empresa todo el trabajo est&#225; </span><span style="font-family: verdana,arial,helvetica,sans-serif;">dividido y seguramente no le toque escribir ni una l&#237;nea de javascript, para optimizar la navegaci&#243;n del usuario, </span><span style="font-family: verdana,arial,helvetica,sans-serif;">resulta necesario al 100&#37;.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Al igual que antes los locos del javascript debieron adaptarse a los descubrimientos m&#225;s &#243;ptimos de las CSS, ahora que </span><span style="font-family: verdana,arial,helvetica,sans-serif;">xmlhttpRequest est&#225; dando fuerte, a los programadores ya no les queda otra que aprender javascript o se quedar&#225;n </span><span style="font-family: verdana,arial,helvetica,sans-serif;">obsoletos. De hecho, todos los programadores tenemos que reintepretar la web y la forma de programar, y se debe </span><span style="font-family: verdana,arial,helvetica,sans-serif;">invertir un per&#237;odo en reflexi&#243;nar al respecto.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif; text-decoration: underline;">Beneficios de una API:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">-Una API de javascript hace como cualquier otra API, centraliza el c&#243;digo, ahorra c&#243;digo y se edita con facilidad </span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">porque s&#243;lo hay que modificarlo una vez.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif; text-decoration: underline;">Negativos de una API:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">-El c&#243;digo se vuelve m&#225;s dif&#237;cil, el programador tiene que aprender nuevos c&#243;digos y sin una buena documentaci&#243;n es de </span><span style="font-family: verdana,arial,helvetica,sans-serif;">dif&#237;cil modificaci&#243;n.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Tomando todo esto en cuenta, yo principalmente opto por las APIs de javascript pero no las totalizadoras, que hacen </span><span style="font-family: verdana,arial,helvetica,sans-serif;">todo lo que quieras en tu web, s&#243;lo en casos concretos, donde las diferencias de c&#243;digos entre navegadores se vuelve </span><span style="font-family: verdana,arial,helvetica,sans-serif;">m&#225;s dispar.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">El caso m&#225;s claro de una buen API es<span style="font-weight: bold;"> la maravillosa y famosa API de dhtmlcentral.com</span>. Es una API que me ha acompa&#241;ado </span><span style="font-family: verdana,arial,helvetica,sans-serif;">siempre y que he mejorado con el tiempo.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Qu&#233; conseguimos con una API si javascript hace unas tareas muy sencillas? Pues simplemente, unificamos el javascript </span><span style="font-family: verdana,arial,helvetica,sans-serif;">que utilizan todos los navegadores. Por ejemplo, para ocultar una capa se hace diferente en IE4 que en IE6, Mozilla o </span><span style="font-family: verdana,arial,helvetica,sans-serif;">Netscape 4.5. Con la API de dhtmlcentral escribimos una l&#237;nea y lo hace compatible para todos.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Esto mismo conseguimos con Sarissa, m&#225;s otras tareas relacionadas con el DOM.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><font size="2" style="font-weight: bold;"><span style="font-family: verdana,arial,helvetica,sans-serif;">Sarissa, la API para Ajax</span></font><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">En este tutorial, voy a tratar 2 m&#233;todos de cargar XML con Ajax.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Uno utilizando XmlhttpRequest y otro cargando XML con el objeto load, que en IE pertenece al ActiveX </span><span style="font-family: verdana,arial,helvetica,sans-serif;">Msxml2.DOMDocument, y que en Mozilla se implementa de otra manera.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">No obstante, como dec&#237;a m&#225;s arriba, no nos vamos a preocupar de las diferencias entre navegadores porque Sarissa har&#225; </span><span style="font-family: verdana,arial,helvetica,sans-serif;">los deberes por nosotros.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">El resultado con ambos m&#233;todos es el mismo. No obstante, xmlhttpRequest, nos ofrece un mejor control sobre el estado </span><span style="font-family: verdana,arial,helvetica,sans-serif;">de la carga del xml, porque podemos utilizar la propiedad ReadyState.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Como &#250;ltimo apunte, Sarissa no se implementa creando una clase Sarissa, sino que se llama de manera est&#225;tica.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Empecemos de lleno:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;"><span style="font-weight: bold;">1.-</span>Bajamos la API de su web.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;"><span style="font-weight: bold;">2.-</span>Incluimos los js:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&lt;script language="javascript" src="sarissa.js"&gt;&lt;/script&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&lt;script language="javascript" src="sarissa_ieemu_xpath.js"&gt;&lt;/script&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;"><span style="font-weight: bold;">3.-</span>Creamos el formulario que describ&#237;a en mi &#250;ltimo tutorial sobre Ajax, pero incluyendo un nuevo enlace que llama a </span><span style="font-family: verdana,arial,helvetica,sans-serif;">getDatosXML para cargar XML utilizando load:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&lt;div id="lblError"&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&lt;/div&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&lt;form id="detalles" name="detalles" method="post"&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&lt;table cellpadding="0" cellspacing="0" border="0"&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;tr&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;td nowrap="nowrap" class="items" style="visibility:hidden"&gt;Metatags:&lt;/td&gt;&lt;td&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;textarea cols="40" rows="1" name="metatags" id="metatags"&gt;&lt;/textarea&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/td&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/tr&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;tr&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;td nowrap="nowrap" class="items" style="visibility:hidden"&gt;Descripci&#243;n:&lt;/td&gt;&lt;td&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;textarea cols="40" rows="1" name="descripcion" id="descripcion"&gt;&lt;/textarea&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/td&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/tr&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;tr&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;td nowrap="nowrap" class="items" style="visibility:hidden"&gt;Descripci&#243;n larga:&lt;/td&gt;&lt;td&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;textarea cols="40" rows="1" name="descripcionlarga" id="descripcionlarga"&gt;&lt;/textarea&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/td&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/tr&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/table&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;div class="buttons1"&gt;&lt;a href="javascript:getDatos()"&gt;Llenar&lt;/a&gt;&lt;/div&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;div class="buttons1"&gt;&lt;a href="javascript:getDatosXML()"&gt;LlenarXML&lt;/a&gt;&lt;/div&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp; &nbsp;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&lt;/form&gt;</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;"><span style="font-weight: bold;">4.-</span>Ahora incluyamos las funciones getDatos y getDatosXML:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">var xmlhttp=null;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">function getDatos(){</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp; if(xmlhttp &amp;&amp; xmlhttp.readyState!=0 &amp;&amp; xmlhttp.readyState!=4){</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; alert("espere mientras la conexi&#243;n anterior termina")</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; return;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp; }</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">strUrl="xmlhttp_select.cs.asp?docid=4"</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">xmlhttp = new XMLHttpRequest();</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">xmlhttp.open("GET", strUrl, true);</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">xmlhttp.onreadystatechange=handlergetDatos</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">xmlhttp.send(null);</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">}</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">function getDatosXML(){</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">strUrl="xmlhttp_select.cs.asp?docid=4"</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">respuestaXML= Sarissa.getDomDocument(); </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">respuestaXML.async = false; </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">respuestaXML.load(strUrl); </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; mostrarDatos(1)</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">}</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Como vemos m&#225;s arriba, hemos reducido mucho el c&#243;digo, ya no tenemos ninguna funci&#243;n que se encarga de crear la </span><span style="font-family: verdana,arial,helvetica,sans-serif;">compatibilidad del objeto xmlhttpRequest. De esto se encarga Sarissa, que ha redefinido el objeto, un poco como se </span><span style="font-family: verdana,arial,helvetica,sans-serif;">hace con los m&#233;todos en .Net con la propiedad "override".</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">De momento, ya vemos un ahorro de c&#243;digo, y adem&#225;s el sistema est&#225; mejorado porque Sarissa para IE, va a hacer un loop </span><span style="font-family: verdana,arial,helvetica,sans-serif;">a trav&#233;s de los diferentes Activex que utiliza IE para crear el xmlHttpRequest hasta que encuentre el apropiado. Es </span><span style="font-family: verdana,arial,helvetica,sans-serif;">decir, los activeX:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">"Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Para la funci&#243;n getDatosXml. Tambi&#233;n ahorramos porque la forma de crear el objeto, lo har&#225; de modo conveniente </span><span style="font-family: verdana,arial,helvetica,sans-serif;">dependiendo del navegador, y adem&#225;s para IE mejorar&#225; el m&#233;todo haciendo un loop buscando la clase apropiada entre:<br /><br style="font-family: verdana,arial,helvetica,sans-serif;" /></span><span style="font-family: verdana,arial,helvetica,sans-serif;">"Msxml2.DOMDocument.5.0", "Msxml2.DOMDocument.4.0", "Msxml2.DOMDocument.3.0", "MSXML2.DOMDocument", </span><span style="font-family: verdana,arial,helvetica,sans-serif;">"MSXML.DOMDocument", "Microsoft.XMLDOM"</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">En mi c&#243;digo, he incluido una mejora:<br /><br style="font-family: verdana,arial,helvetica,sans-serif;" /></span><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">if(xmlhttp &amp;&amp; xmlhttp.readyState!=0 &amp;&amp; xmlhttp.readyState!=4){</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; alert("espere mientras la conexi&#243;n anterior termina")</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">return;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">}<br /><br style="font-family: verdana,arial,helvetica,sans-serif;" /></span><span style="font-family: verdana,arial,helvetica,sans-serif;">Con lo cual nos aseguramos que las diferentes conexiones no se pisan.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;"><span style="font-weight: bold;">5.-</span>Incluyamos la funci&#243;n que controla la carga de datos del xmlhttprequest:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">function handlergetDatos(){</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; if(xmlhttp.readyState==2)</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; {</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; document.getElementById("lblError").innerHTML="Cargando datos";</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; }</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; if(xmlhttp.readyState==3)</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; {</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; document.getElementById("lblError").innerHTML="Datos cargados";</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; }</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; if(xmlhttp.readyState==4)</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; {</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; document.getElementById("lblError").innerHTML="Carga de datos completada";</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(xmlhttp.status==200)</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">respuestaXML=xmlhttp.responseXML</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">mostrarDatos();</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp; </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }else{</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; alert("no se encuentra el documento xml")</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; }</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">}</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Aqu&#237; hemos mejorado la forma de hacer un seguimiento del estado de la conexi&#243;n.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Un detalle a tener en cuenta es que al final la funci&#243;n mostrarDatos, va a utilizar el objeto respuestaXML. En el caso </span><span style="font-family: verdana,arial,helvetica,sans-serif;">de cargarlo como documento XML usando load. La respuesta xml ya esta&#225; contenida en el objeto mismo,pero en el caso de </span><span style="font-family: verdana,arial,helvetica,sans-serif;">xmlhttpRequest, respuestaXML equivale a xmlhttp.responseXML.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Desde ese momento ambos XML son iguales y se tratan igual.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;"><span style="font-weight: bold;">6.-</span>Incluimos la funci&#243;n mostrarDatos:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">function mostrarDatos(){</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">numNode=0;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">document.getElementById("lblError").innerHTML="";</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">try{</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">if(respuestaXML.parseError!=0){</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">throw "Posible formato err&#243;neo:" + respuestaXML.parseError;</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">}</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xmlmetatags=Sarissa.getText(respuestaXML.selectNodes("root/message/metatags")[numNode])</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xmldescripcion=Sarissa.getText(respuestaXML.selectNodes("root/message/descripcion")[numNode])</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">xmldescripcionlarga=Sarissa.getText(respuestaXML.selectNodes("root/message/descripcionlarga")[numNode])</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Sarissa.clearChildNodes(document.getElementById("metatags"))</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Sarissa.clearChildNodes(document.getElementById("descripcion"))</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Sarissa.clearChildNodes(document.getElementById("descripcionlarga"))</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; document.getElementById("metatags").appendChild(document.createTextNode(xmlmetatags))</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; document.getElementById("descripcion").appendChild(document.createTextNode(xmldescripcion))</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; document.getElementById("descripcionlarga").appendChild(document.createTextNode(xmldescripcionlarga))</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">}</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">catch(e)</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">{</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; document.getElementById("lblError").innerHTML="error cargando xml."+e+"&lt;br&gt;Lea la descripc&#237;on del error y </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">p&#243;ngase en contacto con su departamento t&#233;cnico:&lt;br&gt;"+Sarissa.getParseErrorText(respuestaXML);</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; </span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">}</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);" /><span style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(0, 102, 0);">}</span><br style="font-family: verdana,arial,helvetica,sans-serif; color: rgb(51, 102, 102);" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Esta es la funci&#243;n que crea la magia.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Despu&#233;s de haber comprobado que se ha cargado sin problemas, seguimos haciendo comprobaciones:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp; if(respuestaXML.parseError!=0){</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Con esto vamos a saber si el xml est&#225; mal formado.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Sarissa en este sentido nos ofrece 1 propiedad:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">respuestaXML.parseError</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">que deber&#237;a ser 0 si no hay error.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Y un m&#233;todo para recuperar el error:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Sarissa.getParseErrorText(respuestaXML)</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Ahora es cuando utilizamos el segundo .js que incluimos sarissa_ieemu_xpath.js:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">xmlmetatags=Sarissa.getText(respuestaXML.selectNodes("root/message/metatags")[numNode])</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Con el m&#233;todo getText vamos a recuperar el valor del nodo que le indiquemos. Para eso utilizamos el selectNodes si hay </span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">m&#225;s de una misma etiqueta (en este caso metatags) con un &#237;ndice (numNode), o si fuera s&#243;lo uno, selectSingleNode.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><font size="2"><span style="font-family: verdana,arial,helvetica,sans-serif; font-weight: bold;">Fin</span></font><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Hasta aqu&#237; llega mi tutorial, un m&#233;todo muy bueno que utiliza google, ver:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;" /></font><font size="2"><a target="_blank" href="http://serversideguy.blogspot.com/2004/12/google-suggest-dissected.html">http://serversideguy.blogspot.com/2004/12/google-suggest-dissected.html</a></font><font size="1"><span style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Es utilizar en vez de una respuesta xml, una respuesta de texto, y ejecutarla como javascript, as&#237;:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">eval(_xmlHttp.responseText)</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Pero el lado de la fuerza incluye muchos otros m&#233;todos relacionados con hojas de estilo XML </span><span style="font-family: verdana,arial,helvetica,sans-serif;">( </span></font><font size="2"><a target="_blank" href="http://www-128.ibm.com/developerworks/xml/library/x-xslt/?article=xr">http://www-128.ibm.com/developerworks/xml/library/x-xslt/?article=xr</a></font><font size="1"><span style="font-family: verdana,arial,helvetica,sans-serif;"> ) que exploraremos otro d&#237;a.S&#243;lo mostraros un </span><span style="font-family: verdana,arial,helvetica,sans-serif;">ejemplo de diccionario basado en Google Suggests:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;" /><font size="2"><a target="_blank" href="http://www.objectgraph.com/dictionary/">http://www.objectgraph.com/dictionary/</a></font></font><font size="1"><span style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Miguel &#193;ngel.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Programador.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">&nbsp;</span></font>
 ]]>
</description>
 <dc:date>2005-09-19T14:12:00+01:00</dc:date>
 <dc:creator>dactivo</dc:creator>
</item>

<item>
 <title>Ajax o el milagro de Xmlhttprequest</title>
<link>http://widea.zoomblog.com/archivo/2005/09/09/ajax-o-el-milagro-de-Xmlhttprequest.html</link>
 <guid isPermaLink="true">http://widea.zoomblog.com/archivo/2005/09/09/ajax-o-el-milagro-de-Xmlhttprequest.html</guid>
 <description>
 <![CDATA[
<span style="font-family: verdana,arial,helvetica,sans-serif;"><font size="1">Todo programador sabe apreciar la originalidad y buen hacer con el que Gmail, Google Groups, Google Suggest, Google Maps... se han programado, y todos los que saben un poquito hablan del maravilloso mundo del xmlhttprequest. Es como el amigo que uno tiene que hizo una cosa sorprendente pero que nadie conoce.<br />En este art&#237;culo voy a intentar explicar un poco los entresijos de algo que puede ser verdaderamente beneficioso para cualquier cerebrito que quiera mejorar la navegaci&#243;n de sus p&#225;ginas.<br /><br />En primer lugar resaltemos algunas de las prestaciones que luce este nuevo planteamiento:<br /><br />-xmlhttprequest es un objeto que naci&#243; en el Internet Explorer 5 como un ActiveX, y que despu&#233;s pas&#243; a formar parte de los principales navegadores: Mozilla, Safari etc...<br />Es un objeto que se crea desde javascript, y que apunta a una p&#225;gina en el servidor.<br /><br />-</font></span><span style="font-family: verdana,arial,helvetica,sans-serif;"><font size="1"> no hace falta moverse de p&#225;gina </font></span><span style="font-family: verdana,arial,helvetica,sans-serif;"><font size="1">para actuar en el servidor y responder al cliente. Para poner un s&#237;mil, </font></span><span style="font-family: verdana,arial,helvetica,sans-serif;"><font size="1"> hace lo que las llamadas en Actionscript dentro de un flash hacen a otras p&#225;ginas sin que el cliente lo perciba.</font></span><br /><span style="font-family: verdana,arial,helvetica,sans-serif;"><font size="1"><br />-xmlhttprequest adem&#225;s de poder actuar en el servidor, puede devolver datos, por ejemplo, XML, pero tambi&#233;n texto que podemos utilizar a nuestro antojo. En el primer caso, por ejemplo, podr&#237;amos utilizar el DOM para reestructurar la web a partir de un documento xml, y en el segundo caso, si utilizamos texto, podr&#237;a mandar de vuelta la confirmaci&#243;n de que todo fue bien en el servidor.<br /><br />-Por &#250;ltimo y no menos importante, hay una limitaci&#243;n de seguridad, y es que no se puede hacer una llamada a una p&#225;gina que no tenga el mismo dominio que la p&#225;gina que contiene el javascript. Es decir, que no podemos llamar a un web service directamente.<br /><br />Todo esto llevado al s&#233;ptimo arte es el motor principal de Gmail con un javascript supersofisticado,&nbsp; y creo que cualquiera puede apreciar la rapidez y amenidad con que se navega en el popular proveedor de correo.<br /><br />Pero bueno, dej&#233;monos de proleg&#243;menos y hinqu&#233;mosle el diente al asado!!!<br /></font></span><span style="font-family: verdana,arial,helvetica,sans-serif;"><font size="1"><br />&nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">1.-</span> Creemos este formulario:<br /><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&lt;form id="detalles" name="detalles" method="post"&gt;</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &lt;table cellpadding="0" cellspacing="0" border="0"&gt;</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;tr&gt;</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td nowrap="nowrap" class="items"&gt;Metatags:&lt;/td&gt;&lt;td&gt;</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;textarea cols="40" rows="2" name="metatags" id="metatags"&gt;&lt;/textarea&gt;</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/td&gt;</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/tr&gt;</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;tr&gt;</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td nowrap="nowrap" class="items"&gt;Descripci&#243;n:&lt;/td&gt;&lt;td&gt;</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;textarea cols="40" rows="2" name="descripcion" id="descripcion"&gt;&lt;/textarea&gt;</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/td&gt;</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/tr&gt;</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;tr&gt;</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td nowrap="nowrap" class="items"&gt;Descripci&#243;n larga:&lt;/td&gt;&lt;td&gt;</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;textarea cols="40" rows="2" name="descripcionlarga" id="descripcionlarga"&gt;&lt;/textarea&gt;</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/td&gt;</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/tr&gt;</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/table&gt;</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;div id="grabar" class="buttons1"&gt;&lt;a href="#"&gt;Grabar&lt;/a&gt;&lt;/div&gt;</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&lt;/form&gt;</span><br /><br />&nbsp;&nbsp;&nbsp;<span style="font-weight: bold;"> 2.-</span>Como habremos visto, el hyperlink de "Grabar" es una llamada a una funci&#243;n updateDatos. Esta funci&#243;n pone en marcha todo el tinglado!!. <br /><br />Antes de ver dicha funci&#243;n debemos crear el javascript siguiente:<br /><br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;<font size="1"><span style="color: rgb(0, 102, 0);">&nbsp; function getHTTPObject() </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; var xmlhttp;</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; if (!xmlhttp) </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; {</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(window.XMLHttpRequest)</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xmlhttp = new XMLHttpRequest();</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; catch(e) </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alert("mensaje error 1.1")</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xmlhttp = false;</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; // branch for IE/Windows ActiveX version</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else if(window.ActiveXObject)</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; catch(e) </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; catch(e) </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</span><br style="color: rgb(0, 102, 0);" /><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; alert("mensaje de error 1.2")</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xmlhttp = false;</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return xmlhttp;</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">}</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">var http = getHTTPObject(); // We create the HTTP Object</span></font><br /><br /><br />Lo que hemos hecho ha sido crear una instancia del objeto Xmlhttprequest, en el caso de Mozilla y Safari es el objeto </font></span><span style="font-family: verdana,arial,helvetica,sans-serif;"><font size="1">XMLHttpRequest(), y en el caso de Internet Explorer, o </font></span><span style="font-family: verdana,arial,helvetica,sans-serif;"><font size="1">ActiveXObject("Msxml2.XMLHTTP"); o </font></span><span style="font-family: verdana,arial,helvetica,sans-serif;"><font size="1">ActiveXObject("Microsoft.XMLHTTP"). <br /><br />Todo lo dem&#225;s son comprobaciones que son &#250;tiles para ofrecer una mayor capacidad de respuesta al cliente. Un buen sistema de aviso de errores, y esto lo digo para cualquier tipo de programaci&#243;n, debe contener el error y asignarle un n&#250;mero, que a su vez tendr&#237;amos referenciado, al estilo de programas de consola, para que el soporte t&#233;cnico supiera enseguida de qu&#233; se trata.<br /><br />Sigamos, creemos la funci&#243;n de updateDatos():<br /><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">function updateDatos(){</span><br style="color: rgb(0, 102, 0);" /><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;var urldatos = "xmlhttp_insert.cs.asp?"; // The server-side script</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;var metaValue = document.getElementById("metatags").value;</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;var descripValue=document.getElementById("descripcion").value;</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;var descriplargaValue=document.getElementById("descripcionlarga").value;</span><br style="color: rgb(0, 102, 0);" /><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; strUrl=urldatos + "metas=" +escape(metaValue) + "&amp;descrip="+ escape(descripValue)+"&amp;descriplarga="+escape(descriplargaValue); </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; if(http)</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 102, 0);" /><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; http.open("GET",strUrl, true);</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; http.setRequestHeader('Accept','message/x-jl-formresult')</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; http.send(null);</span><br style="color: rgb(0, 102, 0);" /><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; }</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; else</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; {</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; alert("Hubo un problema al conectar. Consulte con soporte t&#233;cnico");</span><br style="color: rgb(0, 102, 0);" /><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;  </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">}</span><br /><br /><br />Aqu&#237; utilizamos la instancia del objeto xmlhttprequest y le asignamos la url de destino:<br /></font></span><span style="font-family: verdana,arial,helvetica,sans-serif;"><font size="1">http.open("GET",strUrl, true);<br /><br />El string con todos los par&#225;metros est&#225;n a&#241;adidos a "urldatos". Por cierto, siempre hacer escape!! ya que se pasa por GET y as&#237; le damos el formato adecuado a la cadena.<br /><br /></font></span><span style="font-family: verdana,arial,helvetica,sans-serif;"><font size="1"> http.onreadystatechange = handleHttpResponse;<br /></font></span><span style="font-family: verdana,arial,helvetica,sans-serif;"><font size="1">http.send(null);<br /><br /></font></span><span style="font-family: verdana,arial,helvetica,sans-serif;"><font size="1">Controlamos el estado de nuestra conexi&#243;n con la url de destino de esta manera. La funci&#243;n handleHttpResponse actuara seg&#250;n si la conexi&#243;n prospera o no.<br /><br /><span style="color: rgb(0, 102, 0);">function handleHttpResponse() {</span><br style="color: rgb(0, 102, 0);" /><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp; if (http.readyState == 4) {</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; // Split the comma delimited response into an array</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; results = http.responseText;</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp;&nbsp; if (http.status == 200) {</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(results=="OK" ){</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; alert("OK:&lt;br&gt;Base de datos actualizada.");</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else{</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; alert("Hubo un problema actualizando, int&#233;ntelo de nuevo, y si devuelve error, por favor, consulte soporte t&#233;cnico");</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; }else{</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; alert ("Hubo un problema actualizando, int&#233;ntelo de nuevo, y si devuelve error, por favor, consulte soporte t&#233;cnico");</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;  </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; </span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">&nbsp; }</span><br style="color: rgb(0, 102, 0);" /><span style="color: rgb(0, 102, 0);">}</span><br /></font></span><span style="font-family: verdana,arial,helvetica,sans-serif;"><font size="1"><br /><span style="font-family: verdana,arial,helvetica,sans-serif;"><font size="1">"http.readyState == 4" nos dice que la conexi&#243;n se ha realizado con &#233;xito, y </font></span><span style="font-family: verdana,arial,helvetica,sans-serif;"><font size="1">"http.status == 200" que la p&#225;gina existe. </font></span><span style="font-family: verdana,arial,helvetica,sans-serif;"><font size="1">results=="OK", simplemente nos informa de c&#243;mo se realiz&#243; todo en el servidor.<br /><br />Bueno, nada m&#225;s me queda recomendaros el siguiente link donde se amplian bastantes conocimientos:<br /><br /></font></span><font size="1"><a href="http://jibbering.com/2002/4/httprequest.html" target="_blank">http://jibbering.com/2002/4/httprequest.html</a></font></font><br /><font size="1"><span style="font-family: verdana,arial,helvetica,sans-serif;"><font size="1"><br />y para los que quer&#233;is el c&#243;digo directamente, un ejemplo sencillito y que aproveche!!:</font></span></font><br /><font size="2"><br /><font size="1" style="color: rgb(0, 102, 0);">&lt;script language="javascript" type="text/javascript"&gt;<br /><br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; function getHTTPObject() <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; var xmlhttp;<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; if (!xmlhttp) <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(window.XMLHttpRequest)<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xmlhttp = new XMLHttpRequest();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; catch(e) <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alert("No se puede realizar la actualizaci&#243;n de datos, consulte con soporte t&#233;cnico")<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xmlhttp = false;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; // branch for IE/Windows ActiveX version<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else if(window.ActiveXObject)<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; catch(e) <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; catch(e) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; alert("No se puede realizar la actualizaci&#243;n de datos, consulte con soporte t&#233;cnico")<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xmlhttp = false;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return xmlhttp;<br />}<br /><br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; function supportsDynamicLabels() <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return&nbsp;&nbsp;&nbsp;&nbsp; document.getElementById &amp;&amp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (window.attachEvent ||window.addEventListener) &amp;&amp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; null == navigator.appVersion.match(/Safari/d+$/);&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br /><br />function handleHttpResponse() {<br /><br />&nbsp; if (http.readyState == 4) {<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; // Split the comma delimited response into an array<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; results = http.responseText;<br />&nbsp;&nbsp;&nbsp;&nbsp; if (http.status == 200) {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(results=="OK" ){<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; document.getElementById("loading").innerHTML="OK:&lt;br&gt;Base de datos actualizada.";<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else{<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; document.getElementById("loading").innerHTML="Hubo un problema actualizando, int&#233;ntelo de nuevo, y si devuelve error, por favor, consulte soporte t&#233;cnico";<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; }else{<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; document.getElementById("loading").innerHTML="Hubo un problema actualizando, int&#233;ntelo de nuevo, y si devuelve error, por favor, consulte soporte t&#233;cnico";<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; setTimeout('document.getElementById("loading").style.display="none"',1500);&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; <br />&nbsp; }<br />}<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; function getHTTPObject() <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; var xmlhttp;<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; if (!xmlhttp) <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(window.XMLHttpRequest)<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xmlhttp = new XMLHttpRequest();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; catch(e) <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alert("No se puede realizar la actualizaci&#243;n de datos, consulte con soporte t&#233;cnico")<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xmlhttp = false;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; // branch for IE/Windows ActiveX version<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else if(window.ActiveXObject)<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; catch(e) <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; catch(e) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; alert("No se puede realizar la actualizaci&#243;n de datos, consulte con soporte t&#233;cnico")<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xmlhttp = false;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return xmlhttp;<br />}<br />var http = getHTTPObject(); // We create the HTTP Object<br /><br />function updateDatos(){<br /><br />document.getElementById("loading").style.display="block";<br /><br />&nbsp;var urldatos = "xmlhttp_insert.cs.asp?"; // The server-side script<br />&nbsp;var metaValue = document.getElementById("metatags").value;<br />&nbsp;var descripValue=document.getElementById("descripcion").value;<br />&nbsp;var descriplargaValue=document.getElementById("descripcionlarga").value;<br /><br />&nbsp;&nbsp;&nbsp; strUrl=urldatos + "metas=" +escape(metaValue) + "&amp;descrip="+ escape(descripValue)+"&amp;descriplarga="+escape(descriplargaValue); <br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; if(http){&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; <br />//http.open("HEAD", "/faq/index.html",true);<br />//&nbsp;&nbsp;&nbsp; &nbsp;http.onreadystatechange=function() {<br />&nbsp; //if (http.readyState==4) {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //alert("Status is "+http.status)<br />&nbsp;&nbsp;&nbsp; //}<br />&nbsp;//}<br />&nbsp;&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp;&nbsp; http.open("GET",strUrl, true);<br />&nbsp;&nbsp;&nbsp; http.onreadystatechange = handleHttpResponse;<br />&nbsp;&nbsp;&nbsp; http.setRequestHeader('Accept','message/x-jl-formresult')<br />&nbsp;&nbsp;&nbsp; http.send(null);<br />&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; else{<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; alert("Hubo un problema al conectar. Consulte con soporte t&#233;cnico");<br />&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; <br />&nbsp; <br />}<br /><br />&nbsp;&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp;&nbsp; function addEvent(objObject, strEventName, fnHandler) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (objObject.addEventListener)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; objObject.addEventListener(strEventName, fnHandler, false);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else if (objObject.attachEvent)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; objObject.attachEvent("on" + strEventName, fnHandler);<br />&nbsp;&nbsp;&nbsp; }<br /><br /><br />&nbsp; function setupLabels() {<br /><br />&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;addEvent(document.getElementById("grabar"),"click",updateDatos);<br />&nbsp;&nbsp;&nbsp; &nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp;&nbsp; &nbsp;<br /><br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if (supportsDynamicLabels()) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addEvent(window, "load", setupLabels);<br />&nbsp;&nbsp;&nbsp; }<br /><br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br /><br /><br />&lt;/script&gt;<br /><br />&lt;BODY&gt;<br />&lt;div id="loading" style="display:none;BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; FONT-WEIGHT: bold; FONT-SIZE: 12px; LEFT: 50px; BORDER-LEFT: black 1px solid; WIDTH: 200px; COLOR: crimson; PADDING-TOP: 20&#37;; BORDER-BOTTOM: black 1px solid; FONT-FAMILY: verdana; POSITION: absolute; TOP: 50px; HEIGHT: 100px; BACKGROUND-COLOR: lightgrey; TEXT-ALIGN: center"&gt;<br />Actualizando<br />&lt;/div&gt;<br />&lt;div id="lblError"&gt;<br />&lt;/div&gt;<br />&lt;form id="detalles" name="detalles" method="post"&gt;<br />&nbsp;&nbsp;&nbsp; &lt;table cellpadding="0" cellspacing="0" border="0"&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;tr&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td nowrap="nowrap" class="items"&gt;Metatags:&lt;/td&gt;&lt;td&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;textarea cols="40" rows="2" name="metatags" id="metatags"&gt;&lt;/textarea&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/td&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;tr&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td nowrap="nowrap" class="items"&gt;Descripci&#243;n:&lt;/td&gt;&lt;td&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;textarea cols="40" rows="2" name="descripcion" id="descripcion"&gt;&lt;/textarea&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/td&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;tr&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td nowrap="nowrap" class="items"&gt;Descripci&#243;n larga:&lt;/td&gt;&lt;td&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;textarea cols="40" rows="2" name="descripcionlarga" id="descripcionlarga"&gt;&lt;/textarea&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/td&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/table&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;div id="grabar" class="buttons1"&gt;&lt;a href="#"&gt;Grabar&lt;/a&gt;&lt;/div&gt;<br />&lt;/form&gt;</font><br /></font><br /></span>
 ]]>
</description>
 <dc:date>2005-09-09T08:53:00+01:00</dc:date>
 <dc:creator>dactivo</dc:creator>
</item>

</channel>
</rss>

