Ver Mensaje Individual
  #2 (permalink)  
Antiguo 01/10/2004, 01:19
flyk
 
Fecha de Ingreso: noviembre-2003
Mensajes: 121
Antigüedad: 21 años, 4 meses
Puntos: 0
Adaptalo

Funciona bien si existe la imagen, si no existe falla. Por lo que antes comprobaría si existe esa imagen.

function fncFoto(strNombre)
{
var url;
var nw;
var strVirtualRoot;
var ctrlBar;
strVirtualRoot = '<%=strRoot%>/images/';
url = strVirtualRoot + fncBlank2Underscore(strNombre) + ".jpg";
alert(url);

ctrlBar = "left=310,top=10," +
"toolbar=0,status=0,menubar=0,scrollbars=0,resizab le=0";
nw = window.open(url, "Foto", ctrlBar);

if (nw)
{
var conten;
conten = "<html><head><title>" + strNombre + "</title></head>";
conten += "<body topMargin=0 leftMargin=0><img src=" + url +
" onLoad='javascript: window.resizeTo(this.width+10,this.height+30);'";
conten += "</body></html>";

nw.document.open("text/html");
nw.document.write(conten);
nw.document.close();
nw.focus();
}
}
__________________
"El saber no me sirve de nada si no es para enseñar"