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
    Regular Coder
    Join Date
    Nov 2002
    Location
    Manchester, UK
    Posts
    533
    Thanks
    4
    Thanked 1 Time in 1 Post

    image path problem...

    hey,

    I'm at the moment coding a wysiwyg editor for a client.. it's all complete except for a problem when inserting image. I've built an image library and users insert files that way... the problem is the image paths...

    the editor is in the root folder, but the code files are in "editor" folder. The problem is that the main editor page images do not show, as they think the paths are wrong.

    Is there a way I can set a variable, eg:

    path = "http://blah.com/" and search through the contents of the HTML replacing every instance of <img src=".... with

    <img src=" + path + ..... so the relative paths are temporarily set as absolute?

    I have the HTML in a string, so I guess it's just a find and replace? Any help is much appreciated!!

  • #2
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <base href="........

  • #3
    Regular Coder
    Join Date
    Nov 2002
    Location
    Manchester, UK
    Posts
    533
    Thanks
    4
    Thanked 1 Time in 1 Post


    /me hits head on wall....

    thanks willy!


  •  

    Posting Permissions

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