View Single Post
Old 09-27-2018, 07:50 PM  
iceboi
Confirmed User
 
Industry Role:
Join Date: Oct 2017
Posts: 302
Code:
let images  = document.getElementsByTagName('img');

for (i=0;i<images.length;i++){
 let imageSrc = images[i].src.replace("http://","http://1");
images[i].src = imageSrc;
}
This code will modify all the images on the page. If you only want to modify 1 image, give the image an id and change "getElementsByTagName" to "getElementById" and replace "img" with the id of the image.

And don't put the script tags withing the img tag. It should be separate as it's own tag.
iceboi is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote