SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Froot r gewd SubKamran's Avatar
    Join Date
    May 2002
    Location
    North Star State
    Posts
    597
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    HTML "src" attribute

    This is my script:

    Code:
    <script language="javascript" type="text/javascript">
    function doEmote(item) {
    window.returnValue = item.src;
    window.close();
    }
    </script>
    Problem is, when it gets me the src, it returns the http://server part too and I don't want that. I want to have a function that only takes the HTML code "src" attribute's text.
    function doEmote(item) { window.returnValue = item.src; window.close(); } function doEmote(item) { window.returnValue = item.src; window.close(); }
    "Sometimes little is more."
    Kamran A
    Web Dev/Designer
    Keyboard not found: Please Press F1 to Continue

  2. #2
    SitePoint Enthusiast
    Join Date
    Nov 2003
    Location
    Australia
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not sure its possible using just .src - As far as im aware, the browser converts any src to a full HTTP path, as it parses the document.

    You could run a regexp to rip out the http://server part.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •