This is a discussion on "How to use a javascript variable to load an image" within the JavaScript Forum section. This forum, and the thread "How to use a javascript variable to load an image are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
How to use a javascript variable to load an image
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
How to use a javascript variable to load an image
Hello anyone,
I'm trying to figure out how to load an image in a certain place using a javascript variable. What I tried:
Can someone point me into the right direction ? Thanks Regards Hans |
|
|
|
|||
|
Re: How to use a javascript variable to load an image
Start by giving the img element an 'id' so that it is easy to find.
You now need to look at using the DOM nodes to change the text within that given img to the required source details. You may be able to get away with using a more simple approach of coding;
|
|
|||
|
Thanks Geoff,
I solved the problem by using:
Now, by changing one simple number, everything will load into the right position(s). Great learning :-} Regards, Hans |
![]() |
| Tags |
| image, variable |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| edit xml image files that load into flash | Janisf | Flash & Multimedia Forum | 1 | Dec 21st, 2007 08:43 |
| Forcing JavaScript to load before images? | JennyChaos | Starting Out | 14 | Jul 13th, 2007 23:02 |
| (javascript)dynamic value to variable in src | alexrozario | JavaScript Forum | 0 | Jul 13th, 2007 07:02 |
| load javascript file | VanHype | JavaScript Forum | 7 | Apr 27th, 2007 15:00 |
| how to load a different image on a web page and attach a hyperlink | everderese | JavaScript Forum | 4 | Apr 2nd, 2007 16:52 |