Obtain relative path to image

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • midwesthills

    #1

    Obtain relative path to image

    Is there a way to obtain the relative path of an image through
    javascript? I'm using document.imageN ame.src right now, and all I get
    is the absolute path. Thanks in advance for the help!
  • AV

    #2
    Re: Obtain relative path to image

    strip from it the url section manipulationg the string.
    sort of:
    url=location.hr ef.substring( location.href.i ndexOf("yourweb .com" )+
    "yourweb.com".l ength );
    ciao




    "midwesthil ls" <midwesthills@h otmail.com> ha scritto nel messaggio
    news:1f28b412.0 311291056.f3568 93@posting.goog le.com...[color=blue]
    > Is there a way to obtain the relative path of an image through
    > javascript? I'm using document.imageN ame.src right now, and all I get
    > is the absolute path. Thanks in advance for the help![/color]


    Comment

    • AV

      #3
      Re: Obtain relative path to image

      sorry, of course I meant
      image.src not location.href, but the idea is the same basically. ciao


      "AV" <NOSPAM@hotmail .com> ha scritto nel messaggio
      news:bqargm$v7b $1@lacerta.tisc alinet.it...[color=blue]
      > strip from it the url section manipulationg the string.
      > sort of:
      > url=location.hr ef.substring( location.href.i ndexOf("yourweb .com" )+
      > "yourweb.com".l ength );
      > ciao
      > http://www.unitedscripters.com/
      >
      >
      >
      > "midwesthil ls" <midwesthills@h otmail.com> ha scritto nel messaggio
      > news:1f28b412.0 311291056.f3568 93@posting.goog le.com...[color=green]
      > > Is there a way to obtain the relative path of an image through
      > > javascript? I'm using document.imageN ame.src right now, and all I get
      > > is the absolute path. Thanks in advance for the help![/color]
      >
      >[/color]


      Comment

      Working...