I need to take an image that was in a Array object image and have it display in a table. this is for a item list the table has four columns one for the image, one for a description, one for a price, and the last for the amount of the item.
I've looked on the internet for help but all I find is how to do image switches for links and slideshows. nothing on how to just pull the image from the array and then print it.
this is the image array Im using, all it will display is the broken image icon.
and here is the code that i tried to use
i also tried it like this but it also didn't work
html wise its just a script in the body that calls a function to performs this and some other items that I already have working
Any help would be nice,
praclarush
I've looked on the internet for help but all I find is how to do image switches for links and slideshows. nothing on how to just pull the image from the array and then print it.
this is the image array Im using, all it will display is the broken image icon.
Code:
//declare image array var product = new Array(); product[0] = new Image(); product[1] = new Image(); product[2] = new Image(); product[3] = new Image(); product[4] = new Image(); product[5] = new Image(); product[6] = new Image(); product[7] = new Image(); product[8] = new Image(); product[9] = new Image(); //populate image array product[0].src = "images/colorpads.jpg"; product[1].src = "images/glue.jpg"; product[2].src = "images/highlighter.jpg"; product[3].src = "images/notecard.jpg"; product[4].src = "images/pad.jpg"; product[5].src = "images/pen.jpg"; product[7].src = "images/pencil.jpg"; product[8].src = "images/permmarkers.jpg"; product[9].src = "images/scissors.jpg";
Code:
document.write("<td class='product_image'>"); document.write("<img id='"+i+"'/>"); document.images[i].src = product[i]; document.write("</td>")
Code:
document.image("<img src="+product[i]+"/>"
Any help would be nice,
praclarush
Comment