You are here: irt.org | FAQ | JavaScript | Window | Q633 [ previous next ]
Only in Netscape Navigator 4 and Internet Explorer 4:
First the main window:
<SCRIPT LANGUAGE="JavaScript"><!--
function openImageWindow(imageSrc,imageTitle) {
fileName = 'template.htm?' + escape(imageSrc) + '&' + escape(imageTitle);
myWindowHandle = window.open(fileName,'windowName','directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=yes');
}
openImageWindow('apicture.gif','Title');
//--></SCRIPT>Then the template window:
<HTML>
<BODY onLoad="if (document.all || document.layers) window.resizeTo(document.images[0].width,document.images[0].height - 0 + 50)">
<SCRIPT LANGUAGE="JavaScript"><!--
var passed = location.search ? unescape(location.search.substring(1)) + '&' : '';
var imageSrc = passed ? passed.substring(0,passed.indexOf('&')) : 'default.gif';
passed = passed.substring(passed.indexOf('&')+1);
var imageTitle = passed ? passed.substring(0,passed.indexOf('&')) : 'Default Title';
document.write('<H1>' + imageTitle + '</H1>');
document.write('<IMG SRC="' + imageSrc + '">');
//--></SCRIPT>
</BODY>
</HTML>