JavaScript can't display Image within an Array

deddyirawan

New Member
I have the following array: \[code\]function theMiddle(){var arrayTheMiddle = new Array (showName.theMiddle +"<br />" + beginingTime.theMiddle +" <br />" + network.abc +"<br />" + duration.thirty +"<br />" + rating.general +"<br />" + description.theMiddle +"<br />" + showImagetheMiddle); document.getElementById("gridbar").innerHTML=(arrayTheMiddle); }\[/code\]The last object in that array, showImagetheMiddle is an image with the following code: \[code\] var showImagetheMiddle = new Image(); showImagetheMiddle.src = 'http://stackoverflow.com/questions/13871268/abc.jpg';\[/code\]All my objects appear on my webpage but the showImagetheMiddle gives me the following error:[object HTMLImageElement]I've looked around but found more complex ways to display an image, I would like to keep it simple and add the image within my existing array (as shown above). Is this possible? If not what am I doing wrong here?Any help would be most appreciated!
 
Back
Top