Ver Mensaje Individual
  #6 (permalink)  
Antiguo 03/11/2011, 07:44
Avatar de tomark4
tomark4
 
Fecha de Ingreso: septiembre-2007
Mensajes: 154
Antigüedad: 16 años, 7 meses
Puntos: 29
Respuesta: Rellenar una variable de sesión a través de un link

Código Javascript:
Ver original
  1. function objetoAjax(){
  2.         var xmlhttp=false;
  3.         try {
  4.                 xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  5.         } catch (e) {
  6.                 try {
  7.                    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  8.                 } catch (E) {
  9.                         xmlhttp = false;
  10.                 }
  11.         }
  12.  
  13.         if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
  14.                 xmlhttp = new XMLHttpRequest();
  15.         }
  16.         return xmlhttp;
  17. }
  18.  
  19. function perfil(datos){
  20.         divResultado = document.getElementById('resultado');
  21.         ajax=objetoAjax();
  22.         ajax.open("GET", datos);
  23.         ajax.onreadystatechange=function() {
  24.                 if (ajax.readyState==4) {
  25.                         divResultado.innerHTML = ajax.responseText
  26.                 }
  27.         }
  28.         ajax.send(null)
  29. }

y en tu link pondrias algo como esto

Código HTML:
Ver original
  1. < a href='javascript:perfil(procesaperfil.php)'>Perfil</a>


algo parecido en google hay varios ejemplos de esto
__________________
"Todos somos ignorantes, pero no todos ignoramos las mismas cosas"

http://www.pctec21.blogspot.com
http://www.pctec21.com