Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Firefox using URL of the parent document instead of the iframe when displaying images

Options
  • 04-08-2005 4:31pm
    #1
    Registered Users Posts: 68,317 ✭✭✭✭


    As it says, it's a weird thing I've found. Can anyone shed any light on it?

    Basically I have a page with two iframes. The contents of these iframes change depending on the variables passed to the page. The images within the documents in the iframes use relative addressing. But when firefox tries to load the image, it uses the URL of the parent document, and not the url of the document containing the image.

    For example, if the page is http://mydomain.tld/reports/index.cfm
    And the page being displayed in the iframe is http://mydomain.tld/reports/Monthly/2005/June.html, then firefox uses http://mydomain.tld/reports/ as the directory for the images instead of http://mydomain.tld/reports/Monthly/2005/

    Any ideas? Static addressing is not an option.


Comments

  • Registered Users Posts: 155 ✭✭tammy


    I think that makes sense as the iframe is an element within the root document, so firefox uses the root directory, no? I have little experience using iframes though.


  • Closed Accounts Posts: 7,145 ✭✭✭DonkeyStyle \o/


    seamus wrote:
    Any ideas? Static addressing is not an option.
    I don't know what scripting you're using for this, but in PHP you could grab the path to the script/page from the server... explode() it to rip out any cruddy crap you don't want (like the filename), reconstruct it with implode() and use these dynamically generated paths for your images... appending each image filename to the end of this path and echo'ing it out to the html.
    This way, you're not relying on static addressing, because the page will find out where it is every time it's run, and adapt its paths to match... it'd certainly give you more freedom... but I'm not sure how much freedom you need, since you haven't told us why static addressing is a no-go.


  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    I don't know what scripting you're using for this, but in PHP you could grab the path to the script/page from the server... explode() it to rip out any cruddy crap you don't want (like the filename), reconstruct it with implode() and use these dynamically generated paths for your images... appending each image filename to the end of this path and echo'ing it out to the html.
    This way, you're not relying on static addressing, because the page will find out where it is every time it's run, and adapt its paths to match... it'd certainly give you more freedom... but I'm not sure how much freedom you need, since you haven't told us why static addressing is a no-go.

    The pages within the frames are static HTML generated by Crystal reports. It outputs this filthy unworkable format, that would involve editing the underlying HTML each time a new page is generated. The area of the site needs to be html-editing free, i.e. updateable by other people. Although it wouldn't be totally impossible to write a PHP script which is called as the source of the iframe, but basically spits out the correct file with the path to the image inserted.

    Good idea, thanks. Though I'd still be interested to know the root cause. Is this a bug in Firefox, or poor standards compliance by IE?


Advertisement