91
rated 0 times
[
96]
[
5]
/ answers: 1 / hits: 33183
/ 11 Years ago, mon, november 18, 2013, 12:00:00
I've looked at many other posts and I think I'm using the exact syntax suggested. However, I'm not getting the images to show up. I have a jsfiddle. Is it a jsfiddle issue? It's also not working on a website I'm working on.
<div id=divtest>Hello</div>
<img id=imgtest />
<img id=imgreal src=http://www.premiumbeat.com/blog/wpcontent/uploads/2012/12/free.jpeg />
var string = url('http://www.premiumbeat.com/blog/wpcontent/uploads/2012/12/free.jpeg');
alert(string)
document.getElementByID(divtest).style.backgroundImage = string;
document.getElementByID(imgtest).src = string;
More From » image