Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

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?

irt.org | Knowledge Base | JavaScript | Image | Q85 [ previous next ]

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?

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?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 6th July 2009. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2009 irt.org, All Rights Reserved.