Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help! Hacking Up a Tag

    I am using a program which dynamically creates content for listings at eBay. This program allows me to upload images to my remote server, and then create listing templates that are dynamically populated. The image call is <<image1inline>> and so forth, however it dumps in a whole img tag: <img src=""> Is there a way to use js to hack off the first x number of characters and the last many so that I can save just the remote address of the picture. Then I can manipulate the images as they are displayed, height, width, border, etc. Please help.

  • #2
    Regular Coder
    Join Date
    May 2005
    Location
    Michigan, USA
    Posts
    566
    Thanks
    0
    Thanked 0 Times in 0 Posts
    SubStr

    - or -

    SubString
    Note: I do not test code. I just write it off the top of my head. There might be bugs in it! But if any thing I gave you the overall theory of what you need to accomplish. Also there are plenty of other ways to accomplish this same thing. I just gave one example of it. Other ways might be faster and more efficient.

  • #3
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,511
    Thanks
    3
    Thanked 504 Times in 491 Posts
    var domain=obj.src.substring(0,lastIndexOf('/'));


  •  

    Posting Permissions

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