views:

51

answers:

2

Hi,

I am using this code:

<div class="infobox-pair">
<div class="ibp-left">
    <iframe width="105" height="350" frameborder="0" scrolling="no" style="width: 311px; height: 105px;" marginwidth="0" marginheight="0" name="infobox_flight" id="ibp-left-iframe" src="http://mywebpage.com/paris"&gt;&lt;/iframe&gt;
</div>
<div class="ibp-right">
    <iframe width="105" height="350" frameborder="0" scrolling="no" style="width: 311px; height: 105px;" marginwidth="0" marginheight="0" name="infobox_package" id="ibp-right-iframe" src="http://mywebpage.com/lisbonne"&gt;&lt;/iframe&gt;
</div>

That is displaying into the same div two different iframes. When I display the page whatever the browser it happens that I can get the same content for both the iframes even if looking at the source code the iframe are still different (based on their src and id).

It doesn't happen 100% of the time, I have to refresh sometimes several times to see it.

Do you have any clue ?

Thanks in advance

+1  A: 

One thing to keep in mind, when you refresh in IE and some other browsers, the browser will retain the "current" src="" value for iframe, so if you navigated around a bit in the iframes, then hit F5, the current last navigated path for each iframe is still in the iframes. Is it possible you navigated to the same page somehow?

The only reliable way to get the iframes to "Reset" back to their initial src values on a refresh(f5) is to use javascript to set their src as a part of the page load event. I recommend setting the initial src in markup to just "about:blank" and alwyas programatically change it.

David
Thx David, I will try this solution for my next update if the problem still appears
JulienH
When you reset the source URL, in JavaScript for example, you can easily add a timestamp parameter. This way the URL will always be unique, and the browser won't simply pull the cached version. Your src URL would end up looking something like this: http://mywebpage.com/paris?ts=1279655438109.
Marcus
A: 

Not working, it display the same iframe src. check out first

chinathambi