Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q85 Can I store a gif image and a background code/or name in a variable and load it on to a frame using the document.write() method?

You are here: irt.org | FAQ | JavaScript | Image | Q85 [ previous next ]

Try something like this:

<script language="JavaScript"><!--
var color = 'teal';
var picture = 'smile.gif';

document.write('<body bgcolor="' + color + '">');
document.write('<img height="100" width="200" src="' + picture + '">');
//--></script>

Feedback on 'Q85 Can I store a gif image and a background code/or name in a variable and load it on to a frame using the document.write() method?'

©2018 Martin Webb