
14/02/2013, 08:52
|
| | Fecha de Ingreso: junio-2012 Ubicación: Santiago de Chile
Mensajes: 29
Antigüedad: 12 años, 9 meses Puntos: 0 | |
Respuesta: funciona solo can alert javascript Gracias nuevamente emprear, la función Buscador() es exácamente como tu la indicas. El tema es el siguiente utilizando tu propio código, si incorporo mando_pcto2() y agrego lo indicado en rojo solo funciona una sin alert:
Otra cosa, no se afecte, el código html no tengo en otra pagina y llamo solo los div.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>titulo</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script type="text/javascript">
//<![CDATA[
var ajax;
function Buscador(){
var xmlHttp=null;
if (window.ActiveXObject)
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
else
if (window.XMLHttpRequest)
xmlHttp = new XMLHttpRequest();
return xmlHttp;
}
function mando_pcto(){
//alert("VERIFIQUE ADICIONALES");
ajax = Buscador();
var Resultados = document.getElementById('resultado_adicionales');
ajax.open("GET","hola.html");
ajax.onreadystatechange = function()
{
if (ajax.readyState == 4){
Resultados.innerHTML = ajax.responseText;
}
}
ajax.send(null)
} function mando_pcto2(){
//alert("VERIFIQUE ADICIONALES");
ajax = Buscador();
var Resultados = document.getElementById('resultado_adicionales2');
ajax.open("GET","hola.html");
ajax.onreadystatechange = function()
{
if (ajax.readyState == 4){
Resultados.innerHTML = ajax.responseText;
}
}
ajax.send(null)
}
//]]>
</script>
</head>
<body>
<button onclick="mando_pcto(),mando_pcto2();">llamar fnc</button>
<div id="resultado_adicionales"></div> <div id="resultado_adicionales2"></div>
</body>
</html> |