brettstix
09-18-2009, 12:12 AM
I have a lot of images displayed on my web page using HTML like this...
<img src="www.mypics.com/pic1.jpg">
As I am regularly changing the pictures I was hoping to be able to store the url for each pictre in a variable so I can have them all in one place e.g.
<HTML>
<TITLE>
My Page
</TITLE>
<HEAD>
Define variable IMAGE1 = "www.mypics.com/pic1.jpg" <!-- I want to store the url in a variable -->
Define variable IMAGE2 = "www.mypics.com/pic2.jpg" <!-- So it is easier to change them -->
</HEAD>
<BODY>
...
...
...
<IMG src=IMAGE1>
...
...
...
<IMG src=IMAGE2>
...
...
...
</BODY>
</HTML>
This way if I want to change the url for each image I don't have to search through the document and can change them all easily.
Is this possible using HTML? Is this possible using Javascript?
If so, could someone point me in the right direction?
Any help would be greatly appreciated.
Thanks.
<img src="www.mypics.com/pic1.jpg">
As I am regularly changing the pictures I was hoping to be able to store the url for each pictre in a variable so I can have them all in one place e.g.
<HTML>
<TITLE>
My Page
</TITLE>
<HEAD>
Define variable IMAGE1 = "www.mypics.com/pic1.jpg" <!-- I want to store the url in a variable -->
Define variable IMAGE2 = "www.mypics.com/pic2.jpg" <!-- So it is easier to change them -->
</HEAD>
<BODY>
...
...
...
<IMG src=IMAGE1>
...
...
...
<IMG src=IMAGE2>
...
...
...
</BODY>
</HTML>
This way if I want to change the url for each image I don't have to search through the document and can change them all easily.
Is this possible using HTML? Is this possible using Javascript?
If so, could someone point me in the right direction?
Any help would be greatly appreciated.
Thanks.