AnsweredAssumed Answered

Adding an Image in HTML doc using JavaScript in Alfresco

Question asked by juilee on May 20, 2014
Latest reply on May 20, 2014 by juilee
I have an image url defined in my javascript code as:
var url = "'+urlStr.substring(4);
I have to pass this as src attribute to an image:

var content = "";
content += "<img src=\"url\">";

But this doesn't work.
I also tried inserting image using document.createElement("img"); and var img = new Image(); but javascript is not able to recognize the createElement() method or the Image() object.
Can anyone suggest how an image can be added to the HTML doc using Javascript in Alfresco?