we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
showing results for - "why i can not insert image with ajax request"
Camila
07 Oct 2020
1            
2
3        var img = document.querySelector('.i');
4            img.setAttribute('src','data/'+e[0]);
5             function loadImage() {
6            context.drawImage(img,0,0)     
7            console.log('Yes');  
8             }     
9             setTimeout(loadImage,100); // set timeout so that the code can take few moment to load;