Here is the actual code:
"function(file,dataUrl){var date = new Date(); var path = window.location.host+'/frontend/web/image/page/'+date.getFullYear()+'/'+(1+date.getMonth())+'/'+file.name;var img='<img src=\"'+path+'\" />'; document.getElementById('forIMG').appendChild(img[0]);}" Quotation marks at the beginning and end of the code are actually needed because I use js in the php plugin, which I broke in lines.
function(file,dataUrl){ var date = new Date(); var path = window.location.host+'/frontend/web/image/page/'+date.getFullYear()+'/'+(1+date.getMonth())+'/'+file.name; var img='<img src=\"'+path+'\" />'; document.getElementById('forIMG').appendChild(img[0]);} tried and so
function(file,dataUrl){ var date = new Date(); var path = window.location.host+'/frontend/web/image/page/'+date.getFullYear()+'/'+(1+date.getMonth())+'/'+file.name; var img='<img src=\"'+path+'\" />'; document.getElementById('forIMG').appendChild(img)[0];} The effect is the same.