Tengo este script:
Código:
<script language="JavaScript">
var win = null;
function ampImg(imag,nombre){
var imagen = new Image();
imagen.src = imag;
imagen.name = 'imagen';
var w = imagen.width;
var h = imagen.height;
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
est =
'height=' + h + ',width=' + w + ',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,resizable';
win = window.open("",nombre,est);
win.document.open();
win.document.write("<html><head><title>");
win.document.write(nombre);
win.document.write("</title></head><body marginwidth='0' leftmargin='0' marginheight='0' topmargin='0'><img src='");
win.document.write(imag);
win.document.write("'></body></html>");
win.document.close();
}
</script>
Y lo llamo de la siguiente forma:
<a href="javascript
:ampImg('anime/lain/img/skin_layer.gif','Lain Layer'');"> [ Aquí ]</a>
Y cuando pulso el link, me da error javascritp... ¿por que sera?