470,586 Members | 1,324 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,586 developers. It's quick & easy.

Obtain relative path to image

Is there a way to obtain the relative path of an image through
javascript? I'm using document.imageName.src right now, and all I get
is the absolute path. Thanks in advance for the help!
Jul 20 '05 #1
2 10157
AV
strip from it the url section manipulationg the string.
sort of:
url=location.href.substring( location.href.indexOf("yourweb.com" )+
"yourweb.com".length );
ciao
http://www.unitedscripters.com/

"midwesthills" <mi**********@hotmail.com> ha scritto nel messaggio
news:1f*************************@posting.google.co m...
Is there a way to obtain the relative path of an image through
javascript? I'm using document.imageName.src right now, and all I get
is the absolute path. Thanks in advance for the help!

Jul 20 '05 #2
AV
sorry, of course I meant
image.src not location.href, but the idea is the same basically. ciao
"AV" <NO****@hotmail.com> ha scritto nel messaggio
news:bq**********@lacerta.tiscalinet.it...
strip from it the url section manipulationg the string.
sort of:
url=location.href.substring( location.href.indexOf("yourweb.com" )+
"yourweb.com".length );
ciao
http://www.unitedscripters.com/

"midwesthills" <mi**********@hotmail.com> ha scritto nel messaggio
news:1f*************************@posting.google.co m...
Is there a way to obtain the relative path of an image through
javascript? I'm using document.imageName.src right now, and all I get
is the absolute path. Thanks in advance for the help!


Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Rizaan Jappie | last post: by
6 posts views Thread by David W. Simmonds | last post: by
6 posts views Thread by openleren | last post: by
4 posts views Thread by Win, Pats | last post: by
2 posts views Thread by Jordan Richard | last post: by
reply views Thread by matthias s. | last post: by
19 posts views Thread by Jerry M. Gartner | last post: by
2 posts views Thread by Ruymán | last post: by
5 posts views Thread by gunjangoyan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.