SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Aug 2008
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    iFrame help needed...

    Due to certain requirements I was left with no alternative but to use a frameset to display a series of pages from another site.

    At times the demand on the other server can be quite high and thus the response from the other site somewhat slow, leaving the visitor sitting there looking at a blank box for a while. Not always, but often enough to be worthy of consideration.

    Omitting a lot of the iFrame parameters in the interests of clarity, here's how I have tried to tackle the problem:
    Code:
    <iframe name="framename" src="https://someURL.com">
    
    Contacting server ... please wait while module is loaded ...
    
    </iframe>
    This doesn't work. No matter how much delay there is I never get to see the "Contacting server" message.

    Yes, I could put a message before the iFrame block, but I'd much rather have something to show in lieu of the remote site until it appears. It was my intention that the "Contacting server" message would be replaced by an animated GIF indicating that something was happening.

    Does anyone know of a way to achieve this?

    TIA

  2. #2
    Guru in training bronze trophy SoulScratch's Avatar
    Join Date
    Apr 2006
    Location
    Maryland
    Posts
    1,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    AFAIK, nothing within the iframe tags is going to display. The src attribute determines what should display. You could have a proxy page such as src="default-message.html" and have your message there. Then with Javascript, create a new hidden dynamic iframe and onload of the newly created iframe, replace your existing one with it.

    On second thought instead of having the initial iframe with src=default-message.html just have something like:

    Code:
    <div id="iframe-wrap"><p id="default-message">Default message.</p></div>
    Then when your dynamic iframe loads with the 'change' event, hide the default-message element, and append the iframe to #iframe-wrap.
    Cross browser css bugs

    Dan Schulz you will be missed

  3. #3
    SitePoint Member
    Join Date
    Aug 2008
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi SoulScratch.

    I sort of get what you're saying, but I'm foggy as to how to do it -- my JavaScript isn't good enough.

    Could you give more detail?

    TIA


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
  •