Results 1 to 7 of 7

Thread: relative paths in Ajax div container

  1. #1
    Join Date
    Nov 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default relative paths in Ajax div container

    1) Script Title:
    relative paths in Ajax div container

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...axtabscontent/

    Wrong with Ajax Div Container http://morocco.delosgaia.nl/nl/visit_to_morocco3.htm
    Correct with iFrame
    http://morocco.delosgaia.nl/nl/visit_to_morocco4.htm

    3) Describe problem:
    Relative paths in ajax div container don't work properly. In http://morocco.delosgaia.nl/nl/visit_to_morocco3.htm I have a Jalbum with relative paths to thumbs and html pages. The calculated paths are wrong and based on the location of the main Ajax page but not on the main page of the JAlbum. The latter must be the correct one.
    Relative paths are working fine with iFrame

    Thanks for any help

  2. #2
    Join Date
    Aug 2004
    Posts
    9,918
    Thanks
    3
    Thanked 969 Times in 957 Posts
    Blog Entries
    15

    Default

    The calculated paths are wrong and based on the location of the main Ajax page but not on the main page of the JAlbum. The latter must be the correct one.
    Not sure how that is wrong though. The relative path is always based on the page embedding the relative link, in this case, the main Ajax page (the page containing the script). The script doesn't tamper with this behavior of the browser.

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,167
    Thanks
    44
    Thanked 3,240 Times in 3,201 Posts
    Blog Entries
    12

    Default

    Ajax content is on the main Ajax (the 'top') page. Iframe content is on its own page, and just appears to be on the top page.

    Solutions -

    With Ajax, either use absolute paths or have your 'top' and external pages in the same directory.

    Or just use iframe.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    Nov 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    Ajax content is on the main Ajax (the 'top') page. Iframe content is on its own page, and just appears to be on the top page.

    Solutions -

    With Ajax, either use absolute paths or have your 'top' and external pages in the same directory.

    Or just use iframe.
    I need to use Ajax containers because I can't find any way to configure the iFrame width and height properly for every seperate iframe. The only way I have found in in the JS file.

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,167
    Thanks
    44
    Thanked 3,240 Times in 3,201 Posts
    Blog Entries
    12

    Default

    Then use absolute paths, or put all pages in the same folder.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    Nov 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for your reply,

    Absolute paths is not possible.

    At the moment I am out , I have tried to configure IFrame height and width in many ways but it seems that it is only possible to configure it globally in the js file.
    Just based CSS styling with the class or id don't work.
    Maybe you have a suggestion

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,167
    Thanks
    44
    Thanked 3,240 Times in 3,201 Posts
    Blog Entries
    12

    Default

    Absolute paths are very possible. In order to use Ajax, you must own both the 'top' and external pages. You could therefore edit the paths. Even if there are thousands of external pages, a good editor program can make quick work of the task. If they are generated, then the program that generates them, in all likelihood, can be modified to use absolute paths.

    You could also place the pages in the same directory, then the relative paths would be valid for both the 'top' and the external pages.

    There is an 'iframe ssi script' on DD here:

    http://www.dynamicdrive.com/dynamici...iframessi2.htm

    that was made made to resize the height of an iframe depending upon the content page's height, but it doesn't work in all browsers and is tricky vis a vis the layout of both the top and the external pages even in FF and IE where at least, in theory, it works. So I would advise against it. If you do want to go down that road, I have a mod of it that also works (only as well in as in those others, which is far from perfect) in Opera. However, as I say, both are tricky/unreliable.
    Last edited by jscheuer1; 11-02-2007 at 06:02 PM.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •