PDA

View Full Version : Any Fix for Firefox Problems w/Iframe Resize Script?



tyler
01-13-2007, 04:49 AM
1) Script Title: Iframe SSI script II

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/iframessi2.htm

3) Describe problem: Dynamic pages not properly handled by FireFox in this script :(


I've looked at some of the problems reported by Firefox users, and a lot of them occurs when the iframe contains a dynamic page (ie: php). It seems to throw dynamic resizing off in Firefox. I'm not sure there's a solution to this, at least I haven't had any success tinkering with the script.
My problem is exactly that. I'm loading php pages and the vertical scroll bar does not resize for my iframes. I do not have the height pre-set to any percentage designation either.

Is there any progress made for a fix that can address this resize issue for firefox users in this predicament (ie. webmasters who are loading dynamic pages such as .php into their iframes).

This is a problem I've had to just settle with for 18 months now for my 20% of users who are on FireFox (~17,000 firefox users/week now). It will make a big difference for me if the code can be tinkered to resolve this. That is the only flaw I have with the script. Otherwise, it does everything else that I need it to do flawlessly and much better than any equivalent script on the net.

Any help would be appreciated. I hope someone could take another look at tinkering with the script since dynamic pages are becoming more and more prevalent as time goes on. I think the script was last tinkered in spring of '05.

jscheuer1
01-13-2007, 05:18 AM
Unless your imported pages also include javascript that requires onload initialization, it would probably be better to use one of the Ajax content scripts for this rather than the resizable iframe script.

See:

http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm

There are other Ajax solutions listed here:

http://www.dynamicdrive.com/dynamicindex17/indexb.html

if the one I've chosen doesn't seem to suit your project.

tyler
01-14-2007, 06:02 PM
You're right jscheuer1, an ajax solution would ideally be better, but in my case the back/forward history functionality is critical due to standalone pictures being a subset of the type of links that are imported/displayed.

I definitely need the an iframe resize script compatible with Firefox for dynamic page imports.

I think it would probably be easier than trying to build a forward/back history stack into the ajax code options in your links. Thanks for the smart suggestions though. I did spend many hours trying them out.

jscheuer1
01-14-2007, 06:58 PM
I don't think that stand-alone images would work with that script in any browser, do they? The script gets the size by querying the page in the iframe, if there is no page, there would be no info. And, browsers differ on what they would do, many will resize the image, others will not and almost all can be configured by the user to do either. Anyways, if you provide a link to your best effort at getting this script to work, I will see what I can do with it. Be sure to include several links on it for the iframe, including several of these image links as well as several page links so I can see what is going on. This sort of script is especially hard to debug for others owing to the cross domain security involved. I cannot easily make a working local copy for testing purposes. But, I will have a look at it, perhaps something will jump out at me.

tyler
01-31-2007, 07:21 PM
Sorry for my late reply, these thread subscriptions are not working for me :(


I don't think that stand-alone images would work with that script in any browser, do they? The script gets the size by querying the page in the iframe, if there is no page, there would be no info.
...
...Anyways, if you provide a link to your best effort at getting this script to work, I will see what I can do with it. Be sure to include several links on it for the iframe, including several of these image links as well as several page links so I can see what is going on.
The script does resize the height of the iframe for images, provided those images are on the same server. Here is a working example (http://www.feetcore.com/Pictures/CoxxAnn-Cream-pics---Foot-Worship-1.html) that demonstrates this. The green background images are viewable. That working example link also shows the iframe script working properly for IE but improperly for Firefox for sizing of the PHP page as well.

Warning about the link. It contains non-nude foot fetish images. FYI.

Would appreciate any debug info you can offer :)

jscheuer1
02-03-2007, 06:16 PM
Well, I would take a look at the javascript console in FF and fix the 20 or so errors in there first. That may not help matters but, it would eliminate them as potential causes. I would also validate the generated source of the php page and if it doesn't pass, make whatever adjustments are needed. As noted earlier, this is a known issue so may not be resolvable. However, if FF isn't seeing valid markup from the server, it cannot get the values it needs to resize the iframe.

tyler
02-03-2007, 06:59 PM
John, you're suggestion about validating my php dynamic page source made all the difference to what I consider a very elusive problem.

It was the doctype designation that was needed.

All I had for starting up the page generation was the basic <html> tag when I should've specified much more for better w3c compliance.

for example, this code was needed at the beginning instead of just my basic <html> tag:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

This made all the difference and completely fixed the problem. Thanks always for your great responses :) This was such a great script and now I think it is perfect as long as some folks know to validate their dynamic page source if they are having problems.

sharathe
09-26-2007, 10:01 AM
Hi,
I am using the script specified and I have added the w3c html validation tag at the top too.But I still see the problem.

I am setting the height of the iframe as document.getElementById("MainB").height = document.getElementById("MainB").body.scrollHeight + 50.
//mainb is the id for the iframe.


The value of the height is about 90000.As a result the height of my page is also increased.But the Iframe does not adjust itself to use the complete space , instead I see a scroll bar for the IFrame.

Any help is appreciated.,
Thanks

jscheuer1
09-26-2007, 03:35 PM
Hi,

I am setting the height of the iframe as
document.getElementById("MainB").height = document.getElementById("MainB").body.scrollHeight + 50.
//mainb is the id for the iframe.


Well the code used for the content document's height by FF in the script from this thread is:


currentfr.contentDocument.body.offsetHeight+FFextraHeight;

That would translate to (using your code as a jumping off point):


document.getElementById("MainB").height = document.getElementById("MainB").contentDocument.body.offsetHeight+50;

However, even with a valid DOCTYPE, if there are other validation errors on the external page, or if it isn't on the same domain as the top page, or if it uses absolute positioning or other styles in such a way that confuse the browser as to its actual height, any of these can cause problems.

sharathe
09-28-2007, 06:05 AM
Hi,
To debug the issue , I have created a simple page with two Iframes.
----------------
<html><head/><body>

<iframe name="first" width="100%" height="60000" src="first.html" scrollbar="yes"></iframe>
<iframe name="second" width="100%" src="second.html"></iframe>

</body></html>

-------------------

The content length of my Iframe is about 55000.And I have set the Height of Iframe as 60000.But the Iframe displays contents only till around 33000(px) and shows a scrollbar.Leaving the extra space as blank.It somehow does not use the whole space , and always limits itself to 33000.Is this a problem with Firefox???

Thanks for your help,
SharathChandra.

sharathe
09-28-2007, 06:16 AM
The problem appears when there is no "scrollbar='yes" if the first Iframe tag also .

jscheuer1
09-28-2007, 03:26 PM
I'm not aware of any problem in FF when using really tall iframes. Then again, I don't know for a fact that there isn't one. A link to your problem page would help:

Please post a link to the page on your site that contains the problematic script so we can check it out.