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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Feb 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    problems using layers to function as frames

    ok, i don't know whether anyone has done this before, but I stumbled on a javascript that loads html files into a layer, and I thought why not use layers as frames, so that I have a layer as the top menu bar, and a layer as the main content area. works ok except that when html files are loaded, the base url remains as that of the main file, so all the images and links are wrong. for eg, if my main file (with the layers) is in the root folder, and i load a file "articles.htm" from the folder "mathematics" which contain some images like "logo.jpg", the image will not load since <img src"logo.jpg"> will be interpreted to be from root:logo.jpg instead of mathematics/logo.jpg.

    i dun want to change the loaded files, since by doing so i cannot read that file alone without loading it from the main file. anyone has done this before and can offer some tips or advice?

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Posts
    623
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't think there's much you can do. You have to use valid paths. You could use absolute URLs example

    http://www.codingforums.com/myImage.gif


  •  

    Posting Permissions

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