Foros del Web » Programando para Internet » Javascript »

imprimir() no me funciona en IE7

Estas en el tema de imprimir() no me funciona en IE7 en el foro de Javascript en Foros del Web. Hola amigos tengo esta funcion en javascript que imprime una porcion de la pagina. El problema es que no me imprime en IE7 y si ...
  #1 (permalink)  
Antiguo 01/05/2008, 08:16
 
Fecha de Ingreso: enero-2007
Mensajes: 77
Antigüedad: 17 años, 3 meses
Puntos: 1
imprimir() no me funciona en IE7

Hola amigos tengo esta funcion en javascript que imprime una porcion de la pagina.
El problema es que no me imprime en IE7 y si en Firefox

En IE7 simplemente se habre y se cierra como si se olvidara de hacer el print()

Cita:
function imprimir()
{
var ven_im = window.open('GEN','_blank','width=780,left=150');
ven_im.document.write('<html><head><title>Imprimir </title><link type="text/css" href="css/basico.css" rel="stylesheet" /></head><body>' + document.getElementById('imprimir').innerHTML + '</body></html>');
ven_im.print();
ven_im.close();
}
Gracias
  #2 (permalink)  
Antiguo 03/05/2008, 17:05
 
Fecha de Ingreso: enero-2007
Mensajes: 77
Antigüedad: 17 años, 3 meses
Puntos: 1
Re: imprimir() no me funciona en IE7

nadie contesta?
  #3 (permalink)  
Antiguo 03/05/2008, 17:18
 
Fecha de Ingreso: diciembre-2007
Mensajes: 169
Antigüedad: 16 años, 4 meses
Puntos: 6
De acuerdo Re: imprimir() no me funciona en IE7

Yo tengo un código que hice una vez a mi me funciono sin problemas, aun me funciona en iexplore!!

Aquí esta el javascript:
Código PHP:
function imprimir()
{    
    var 
width=800;
    var 
height=430;
    var 
from_top=100;
    var 
from_left=150;
    var 
toolbar='no';
    var 
location='no';
    var 
directories='no';
    var 
status='no';
    var 
menubar='no';
    var 
scrollbars='yes';
    var 
resizable='yes';
    var 
atts='width='+width+'show,height='+height+',top='+from_top+',screenY=';
    
atts+= from_top+',left='+from_left+',screenX='+from_left+',toolbar='+toolbar;
    
atts+=',location='+location+',directories='+directories+',status='+status;
    
atts+=',menubar='+menubar+',scrollbars='+scrollbars+',resizable='+resizable;
    
    
newwindow2=window.open('','win_name',atts);    
    var 
tmp newwindow2.document;
    
    
tmp.write('<html><head><title>Titulo de Ventana</title>');
    
tmp.write('</head><body onload="javascript:window.print();">');    
    
tmp.write('<table width="740" cellpadding="3" cellspacing="1" border="1" style:"border: solid" >     \
                  <tr> \
                    <td height="30" width="120">Producto</td> \
                    <td height="30" width="400">Informaci&oacute;n</td> \
                    <td height="30" width="90">Precio</td> \
                  </tr> \
            </table> '
);
    
tmp.write('</body></html>');
    
tmp.close();

Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 22:42.