Quote:
Originally Posted by 2MuchMark
Greetings earthlings,
I have a program that generates the URL of am image that looks like this
http://something.jpg
and it appears in the img code like this:
<img src = "http://something.jpg">
What I need is a javascript that will insert a 1 into the file name so that the URL looks like this
http://1something.jpg"
so that the code looks like
<img src = "<script>blahblah</script>">
STUPID question I know, but I just can't seem to figure this out. Any help gets you titties. thanks!
|
Code:
<script>
document.addEventListener("DOMContentLoaded", function(event) {
var imgs = document.getElementsByTagName("img");
var ctr = imgs.length;
var i;
for (i = 0; i < ctr; i++) {
hold = imgs[i].src;
imgs[i].src = hold.replace("https://","https://1");
}
});
</script>
** Proudly accepting spare change at paypal to get account out of negative.
