rac2,
thanks. I tried you eval method, but no luck. Netscape 6 and 7 don't seem to support any form of javascript shorthand within the src attribute of an img tag. I can't get ANYTHING written with Javascript successfully in the src attribute for NS 6/7.
Thanks tho
Plex
I am currently using the following code to call up images but the code works only in IE. Is there a way to code it so it works both in Netscape 6/7 and IE????
<img name="myImg" src="javascript:document.myImg.src='assets/' + variable + '/imagename.gif'">
Plex
Ok, I got it... here it is and it works:
<img name="myImg" src="javascript:document.myImg.src='assets/' + variable + '/imagename.gif'">
Thanks all!
Plex
stormbind,
I am trying to avaid having to write the whole img tag with JS, hopefully i can simply insert the variable in some sort of short-hand JS manner...
thnx
mwolf00,
thanks. The onLoad method actually works... however, in IE 5 on a pc the page continues to try and load something - the image source I think - indefinitely, like its caught in some kind of loop, strange.
I need to insert a JavaScript variable into an img src attribute, something like:
<img src="images/" + JavaScript variable + "/imagename.gif">
Can this be done?
Pleximus
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.