Here is an example of a script that will write data to a page:
<script language="JavaScript">
var img
var imageToLoad
var sVarA
var sVarRS
var newwindow
var newdocument
var sToPass
function newWindow(img){
imageToLoad = new Image();
new function testit(){
imageToLoad.src = (img);
// we need a little pause while the script gets the image since the image is on the server,
// or the browser will open the window and write the script before the image is cached,
// which causes the script to write zeros for the resizeto dimensions.
setTimeout(loadit,1000);
function loadit(){
sVarA = ("left=20px"+",top=20px"+",width="+imageToLoad.width+",height="+imageToLoad.height);
sVarRS = 'onload="resizeTo('+imageToLoad.width+','+imageToLoad.height+')"'
sToPass='<html><head>\n';
sToPass+='<style type="text/css"> body{ background-repeat: no-repeat; }</style>\n';
sToPass+='<title>'+img+'</title>\n';
sToPass+='</head>\n';
sToPass+='<body '+sVarRS+' background='+img+'><p align=center>
www.95isalive.com</p>\n';
sToPass+='</body></html>';
//check to see if we have the dimensions and if not, go back and wait another 1 second
if ( imageToLoad.width = 0 ){ testit(); }
else
newwindow = window.open('','',sVarA);
newdocument = newwindow.document;
newdocument.write(sToPass);
newdocument.close();
}}}
</script>
It is used on this page:
http://www.95isalive.com/test/
The new "pages" that open with the images do not actually exist. The script creates them "on the
fly"
If you modify this line: newwindow = window.open('','',sVarA);
you can specify a file to open and write to.
--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer