By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,600 Members | 1,887 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,600 IT Pros & Developers. It's quick & easy.

Obtain relative path to image

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.