Forum Moderators: open
maybe someone here can clear it up for me. The script is just to expand an image window.
heres the code:
</head>
<script language=JavaScript>
var width,height,title
var image,ext
var cond1,cond2
function transferview(image,width,height,title) {
if (width==0) cond1=" "
else cond1="width="+(width)+"";
if (height==0) {cond2=" "};
else {cond2="height="+(height)+""};
var s1 ="<img src='"+image+"' border='0' style='position:absolute; top:0px; left:0px'>"
ImageWindow=window.open("", "newwin"+width,"toolbar=no,scrollbars="+scroll+",menubar=no,"+cond1+","+cond2);
ImageWindow.document.write(s1)
ImageWindow.document.write("<title>")
ImageWindow.document.write
(title)
ImageWindow.document.write("</title>")
ImageWindow.document.close()
}
</script>
<body bgcolor="#000000" background="Phoenix3.png" text="#FFFFFF" link="#FFFFFF">
<div align="left">
<table width="75%" border="0">
<tr>
<td width="9%" height="70"> <div align="right"><a onClick="javascript:transferview('pics/Cameleon.jpg',720,576,'Cameleon')" href="javascript:;"><img src="pics/Cameleonsmall.jpg" width="75" border="1"></a></div></td>
...
[1][[b]edited by[/b]: Godzero at 2:52 am (utc) on May 15, 2007][/1]
The declaration need to change:
<script language=JavaScript>
<script type='text/javascript'>
Language isn't used any more.
if (width==0) cond1=" "
else cond1="width="+(width)+"";
if (height==0) {cond2=" "}; // WELL SPOTTED
else {cond2="height="+(height)+""};
See that semi-colon? It shouldn't be there, or the one on the next line, it's either a syntax error, or it's ending the if statement before the else, making the else an error. Also as it's only 1 line, you don't need the {}'s at all.
if (width==0) cond1=" ";
else cond1="width="+(width)+"";
if (height==0) cond2=" ";
else cond2="height="+(height)+"";
IE probably just ignores them, but that should have fixed it.