PDA

View Full Version : print image in javascript



mutago
06-09-2014, 09:30 PM
am trying to output images from database via json. the code below displays the image name eg mutago.jpg.



chat_div.innerHTML += response.messages.message[i].user_image + '<br />';


i want to display the real image in directory upload. i have trie this below



chat_div.innerHTML += <img src="upload/ ' response.messages.message[i].user_image +'"> '<br />';



Any help

vwphillips
06-10-2014, 08:21 AM
chat_div.innerHTML+='<img src="upload/ '+response.messages.message[i].user_image+'" ><br />';