Ver Mensaje Individual
  #3 (permalink)  
Antiguo 08/08/2008, 09:35
Avatar de Panino5001
Panino5001
Me alejo de Omelas
 
Fecha de Ingreso: mayo-2004
Ubicación: -34.637167,-58.462984
Mensajes: 5.148
Antigüedad: 20 años
Puntos: 834
Respuesta: Obtener el valor del Iframe

Cita:
var w=document.getElementById('miframe');
var bodyIframe = w.contentWindow.document;
alert(bodyIframe);
Eso no te da el body sino el document del iframe.
Para obtener el html correspondiente a un elemento con id "pp" del iframe con id miframe, sería así:
Código PHP:
ifr=document.getElementById('miframe');
docIfr=ifr.contentDocument || ifr.contentWindow.document;
htmlPP=docIfr.getElementById('pp').innerHTML
y si pp fuera un campo de formulario, para obtener su atributo value, sería así:
Código PHP:
ifr=document.getElementById('miframe');
docIfr=ifr.contentDocument || ifr.contentWindow.document;
htmlPP=docIfr.getElementById('pp').value