This is a discussion on "add image src from javascript function" within the JavaScript Forum section. This forum, and the thread "add image src from javascript function are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
add image src from javascript function
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
add image src from javascript function
Hello,
I have a js function inside the head of a page of mine which takes 2 arguments that are created dynamically based on what I retrieve from a database. My question is whether I can set the attribute src of the <img> tag through the js function. What I have is:
I would greatly appreciate any help! |
|
|
|
||||
|
Re: add image src from javascript function
The code looks fine. The most likely error is that "css/images/show.gif" does not exist.
This is a common mistake developers make when using relative paths. on /index.htm "css/images/show.gif" points to: /css/images/show.gif on /folder/index.htm "css/images/show.gif" points to: /folder/css/images/show.gif Double check.
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| javascript show/hide function | danny322 | JavaScript Forum | 1 | May 15th, 2008 12:46 |
| Something kooky going on with my layout when I use a Javascript function... | jonnymorris | Web Page Design | 3 | Mar 28th, 2008 16:13 |
| Difficulty calling a javascript function? | grittyminder | JavaScript Forum | 4 | Jul 21st, 2005 17:48 |
| help with javascript function | kinjiro | JavaScript Forum | 1 | Nov 21st, 2003 15:58 |
| calling a javascript function in from VBscript | jakyra | Classic ASP | 2 | Sep 22nd, 2003 23:13 |