J
John Kopf
I've tried seversl experiments, but the results appear inconclusive...
I write a js function that includes a document.write statement.
If i place that function within a HTML HEAD, I find no results of that
write in the output document.
If I put the same document.write in the BODY, the output appears
(somewhere).
If I put the function within the BODY, the output sometimes appears - is
it supposed to appear at the location of the function or at the location
of the call?
(What I'm trying to do is create a function, whose arguments are a
image-file name and a caption, to create a captioned image within the
document; successive calls would then create a "slide strip".
I know that I could have the function return a (massive) string to feed
to the document.write, thus:
document.write( TableMake( image1.jpg, "caption 1" ) );
document.write( TableMake( image2.jpg, "caption 2" ) );
document.write( TableMake( image3.jpg, "caption 3" ) );
...
....but that seem clumsy especially if there are hundreds of images
(e.g., portraits of a club"s membership),.
Any suggestions as to where to place the function , the document.write
that actually places the object HTML code, and where to invoke the
function eithin the document?
John Kopf
I write a js function that includes a document.write statement.
If i place that function within a HTML HEAD, I find no results of that
write in the output document.
If I put the same document.write in the BODY, the output appears
(somewhere).
If I put the function within the BODY, the output sometimes appears - is
it supposed to appear at the location of the function or at the location
of the call?
(What I'm trying to do is create a function, whose arguments are a
image-file name and a caption, to create a captioned image within the
document; successive calls would then create a "slide strip".
I know that I could have the function return a (massive) string to feed
to the document.write, thus:
document.write( TableMake( image1.jpg, "caption 1" ) );
document.write( TableMake( image2.jpg, "caption 2" ) );
document.write( TableMake( image3.jpg, "caption 3" ) );
...
....but that seem clumsy especially if there are hundreds of images
(e.g., portraits of a club"s membership),.
Any suggestions as to where to place the function , the document.write
that actually places the object HTML code, and where to invoke the
function eithin the document?
John Kopf