Re: JScript + PHP

From: Date: Tue, 23 Nov 2004 13:37:30 +0000
Subject: Re: JScript + PHP
References: 1  Groups: php.general.es 
Request: Send a blank email to general-es+get-52325@lists.php.net to get a copy of this message
Con xmhttp la pagina ni siquiera recarga, google te ayudara, pero aca te paso un ejemplo que use con jscript: <script> function LlamadaXmlHttp(){ var url = 'http://wwloquesea.com/archivo.asp'; /*********************CREO EL OBJECTO XMLHTTP****************************/ var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) // JScript gives us Conditional compilation, we can cope with old IE versions. // and security blocked creation of the objects. try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } @end @*/ if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp = new XMLHttpRequest(); } /*********************CREO EL OBJECTO XMLHTTP****************************/ try { //Veo si esto se ejecuta xmlhttp.open("GET",url, true); //Llamada asincronica xmlhttp.onreadystatechange = function (){ //Va capturandolo estados de la pagina if(xmlhttp.readyState == 4){ //Estado 4 terminado var respuesta = xmlhttp.responseText; //Lo que devuelve alert(respuesta); //Imprmimo lo que me devuelve el archivo .php } } xmlhttp.send(null); } catch (e){ //Si Try no se ejecuta intento con esto alert("Su Browser no soporta Xmlhttp"); document.location.href = "chau.asp"; } } // llamada a la funcion LlamadaXmlHttp(); </script> <jrubi@menta.net> wrote in message news:20041123100951.HCZC25869.smtp02.retemail.es@smtp02... > Hola, > > Necesito ejecutar PHP desde JScript y obtener el resultado en una variable de JScript. > > ¿Alguien me ayuda? > > Saludos y gracias anticipadas. > > Jorge Rubí

« previous php.general.es (#52325) next »