PDA

View Full Version : Iframe SSI script II and Firefox problem



webcan
09-21-2005, 12:29 AM
HI! There is a small issue that I would like others to test for.

The script works fine in IE but in firefox/mozilla I noticed one small problem.

If you load a large page into the iframe lets say 2000px and then load another page with a smaller size like 600px the body of the main page stays at 2000px.

The iframe resizes ok though its just the body does not resize to fit the content at a smaller size.

I tried everyting from setting the tables to 100% and then Auto. and also changing the magins to 0 and all with no prevail.

Another user also tried this and noticed the same problem in mozilla.

I have tried this with firefox 1.04 of win XP pro system.

ps. is there going to be a new version for Opera?

Paul

Cyrandir
11-29-2005, 05:42 AM
*bump*
I have this same problem... does anyone have any suggestions?

jscheuer1
11-29-2005, 06:56 AM
I think it does have to do with the page layout. To diagnose something like that I would need to see a demo of the problem. When you say 'tables to 100%', that worries me as this script is not intended to be used with tables per se.

One solution would probably be to redesign the page so that it doesn't use tables, or at least less tables. Especially to be avoided (not just for this script, but also for general design purposes) are nested tables. The fewer of those the better, for many reasons (load time for one). I also recall solving a similar problem (perhaps with a different script but, one that did dynamically change the page size) by loading in a very small content piece very quickly in between transitions. For some reason this 'got it' for that particular layout. But, ultimately we went with a redesign that eliminated most of the tables.

.

Cyrandir
12-02-2005, 06:28 PM
well, let's see...

A test installation of the site shows that the problem is still occurring. You can view the problem at www.skylineservices.net. As stated previously, it only happens in FF, IE seems to be fine.

Thanks!

jscheuer1
12-02-2005, 07:42 PM
Page designers are often much more particular about their presentation's precise look than the casual observer or even someone like me who has an eye for the odd looking.

Frankly, I can see no major difference between the two browser's representation of the pages here.

Cyrandir
12-02-2005, 08:44 PM
The major difference is that the body does not resize once you load a page that has a smaller content than one previously. This means that the footer does not come back up to the bottom of the content as it does in IE. This translates into a large area of blank space between the content and the footer. This is not the case in the example given for the SSI script, a'la the content below the example comes back up to the bottom of the example picture/content.

jscheuer1
12-02-2005, 10:41 PM
Well, I am aware of how that can happen in some cases. In this case, the added space in FF was either so little that it didn't seem to make a difference or, there is something different on my end to render it so. To try and find out what that may be:

What screen resolution are you using?

What OS do you have?

What version of FF are you using?

Cyrandir
12-03-2005, 07:22 AM
In response to your questions:

1. resolutions ranging from 1024-1600

2. win98, 2k, XP, 2k3

3. FF 1.07 and 1.5

If you've seen this before, what, if any, were the fixes for this? And, if I may be so bold, what configs are you viewing on? Just so I can attempt to recreate your results?

jscheuer1
12-03-2005, 08:07 AM
Thanks for that. I played around on your demo page a bit more and saw that, yes it does do what you describe. Viewing here in 1024x768 it is hardly enough to worry about but, enough that I can certainly see how it would bother me if I were the designer. Part of the reason I didn't pick up on it the first time though, is because the link to home doesn't load the home content back into the iframe but rather, reloads the home page. Each time I clicked on that link in FF, it looked like things were going back to 'normal'.

The reasons for why this may happen are many and various. I tried disabling all your height declarations in your css, that was no help. My next step was to be to look at the markup. I'm doing that now and this style evaded me the first time through because it did not show up in the FF style editing utility:


<div style="height:100%"> <!-- style for Opera compatibility DO NOT REMOVE -->

That may be specifically required for Opera, for your page but, it shouldn't be. It isn't required for the SSI II script that I can tell. Try removing it to see if that fixes things in FF. If that doesn't do it, I'd try removing height declarations from each element starting with the largest values and working your way down. Heights are often specified for no good reason, the content usually sets the height. I'd think that the above code section is probably it in FF. 100% height is meaningless until it is filled with content, then it becomes the size of the content and, in some browsers will not relinquish that window real estate later if the content shrinks. If you really need it for Opera you could change it to a script:


<script type="text/javascript">
if (window.opera)
document.write('<div style="height:100%">')
</script>

That, or better yet, give it an id:


<div id="opera" style="height:100%"> <!-- style for Opera compatibility DO NOT REMOVE -->

and follow it on the page with a script that will remove its style for FF and other browsers that may also find it conflicts with the SSI II script:


<script type="text/javascript">
if (document.getElementById&&!document.all)
document.getElementById('opera').removeAttribute('style')
</script>

As I recall, there were other percentage heights set in your stylesheet. These may or may not also be a part of the problem.

FPV
12-03-2005, 09:36 PM
Hello,
I have the same problems with my page. I've designed my index page with a layout table and one cell (td) is an iframe. The iframe size adjusts automatically to the size of the targeted page in IE but not in FF.

It's just like if FF didn't update the size for each new page but kept in memory the last size of the iframe :it starts too small then it gets bigger (with a higher page) and then it doesn't get smaller !!

What can I do ? Talk a look if you want : www.pepsimola.com
It's a personal site but if you have a minute that would be great.

Thanks a lot,
FPV
MY BAD OK IT ONLY WORKS WITH PAGES FROM THE SAME DOMAIN !

jscheuer1
12-03-2005, 10:53 PM
You can try removing the height from the td:


<td height="420" colspan="5" valign="top"><iframe id="complet" src="accueil.html" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100%; display:none"></iframe> &nbsp;</td>

Cyrandir
12-03-2005, 11:01 PM
Thanks for your comments, I'll try them out. The reload of the entire site when clicking home was my simple response to this very problem, hoping to at least bring it back up from time to time, obviously something I'd like to avoid. I'll give your suggestions a whirl and report back. Thanks again for your analysis/time.

Cyrandir
12-03-2005, 11:36 PM
Ok, I went through and just started deleting height tags, and eventually everything started working the way it should! Thank you so much!!

On a somewhat related note, the iframe isnt resizing in opera, it is simply staying the small size and getting scrollbars.... any help on this one?

YOU ARE THE MAN!! thanks so much

jscheuer1
12-04-2005, 12:44 AM
The script isn't rated for Opera. I have some ideas for making it look better in Opera but, I'll have to get back to you.

Cyrandir
12-04-2005, 05:53 AM
OK, np. Is this something you might work on in the near future? or should I check back later later?

Thanks for all your hard work, the community appreciates it!

jscheuer1
12-04-2005, 07:52 AM
This will also help with non-javascript enabled browsers. OK, if you set the script to hide the iframe from Opera and other nonsupporting browsers (from looking at the script, it looks like it is only Opera, as other nonsupporting browsers either can't do iframes at all, or won't be excluded by setting this to "yes"):


//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"

You can then put this script and noscript block just below the existing iframe (your existing iframe code is shown in green, as a reference):


<td><iframe src="home.html" name="content" width="100%" marginwidth="0" marginheight="0" align="top" frameborder="0" hspace="0" vspace="0" id="content" style="overflow:visible; width:100%; display:none"></iframe>
<script type="text/javascript">
if (window.opera)
document.write('<iframe src="home.html" name="operaFrame" marginwidth="0" marginheight="0" scrolling="no" height="422" align="top" frameborder="0" hspace="0" vspace="0" style="overflow:visible; width:100%;"></iframe>')
</script>
<noscript><iframe src="home.html" name="noScriptFrame" marginwidth="0" marginheight="0" scrolling="no" height="422" align="top" frameborder="0" hspace="0" vspace="0" style="overflow:visible; width:100%;"></iframe></noscript>

And for all of your links that are like this one:


<a href="javascript:loadintoIframe('content', 'services.html')">Services</a>

You can make them like so:


<a href="services.html" target="noScriptFrame" onclick="if (window.opera){operaFrame.location.replace(this.href)}else{javascript:loadintoIframe('content', this.href);}return false;">Services</a>

One glitch to this strategy is that with shorter content, there is a white background showing through at the bottom of the fixed height iframe. This may be able to be fixed by setting the:

<body style="background-color: #CCCC99;">

style for the body tag on each page that gets loaded into the iframe.

Another potential consideration is that you may want to set the width to say, 102% for the two new iframes and remove the scrolling="no" attribute to allow for long content.

Try this out by adding the extra iframes, setting the variable in the script and first changing just one link and setting the background for its page as I mentioned, for testing in Opera. That is what I've done here, up to a point, as I didn't want to download all of your pages and graphics for testing and would lose the layout and graphics if I tried it with just one page.

jscheuer1
12-04-2005, 02:39 PM
The more I looked into this script, the iframes SSI II script, the less I liked it. When I discovered that Opera actually allows for dynamic resizing of the iframe, just not in the way this script goes about it, I liked it even less. I've updated the script almost beyond recognition. It's usage is entirely different as well.

Here are two sample iframes, you can use one or as many as you want:


<iframe name="I3" onload="sizeFrame(this)" src="page_1.htm" marginwidth="0" marginheight="0" vspace="0" hspace="0" frameborder="1" width="100%" height="350"></iframe>
<iframe name="I5" onload="sizeFrame(this)" src="page_2.htm" marginwidth="0" marginheight="0" vspace="0" hspace="0" frameborder="1" width="100%" height="270"></iframe>

The red part is the essential part. The:

marginwidth="0" marginheight="0" vspace="0" hspace="0"

are all very good ideas. The width is configurable (still best at 100%) and will be taken into account when resizing the iframe. If your content is wider than the iframe there will be a horizontal scrollbar. Browsers that do not support the script will get a regular iframe (if that is supported - see any regular iframe documentation for alternate content for non-iframe browsers) as will those that have javascript disabled. Configure the height (do not set height of the iframe using style, use the height attribute) of the iframe to a reasonable size for those situations, it will be resized by the script in all other situations. Set the frameborder to 1 (yes) or 0 (no) as you prefer.

Links may now be handled in the conventional HTML manner:

1 ) From within the iframe to the same iframe, just use a regular link.

2 ) From either on the top page or from within an iframe to another iframe, target the iframe's name:


<a href="some.htm" target="frameName">Link</a>

In both cases the iframe will resize automatically.

Care must still be taken not to place the iframe(s) using this script inside of elements with their heights set, especially by percentage. This only seems to be an issue in Mozilla (FF etc.)

Here is the script, it goes in the head of your page:


<script type="text/javascript">

/***********************************************
* IFrame SSI script III- © jscheuer1 (http://www.dynamicdrive.com/forums)
* very loosely based upon IFrame SSI script II- © DynamicDrive
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/

function collectWidth(obj){
var wVal=0
var objs=obj.document.getElementsByTagName('*')
for (var i_tem = 0; i_tem < objs.length; i_tem++){
wVal=Math.max(objs[i_tem].offsetWidth, wVal)
}
return wVal;
}

function sizeFrame(frameObj){
if ((frameObj.contentDocument && (frameObj.contentDocument.body.offsetHeight||frameObj.contentDocument.documentElement.offsetHeight))||frameObj.Document && frameObj.Document.body.scrollHeight){
var contentHeight=window.opera? frameObj.contentDocument.documentElement.offsetHeight : frameObj.contentDocument? frameObj.contentDocument.body.offsetHeight : frameObj.Document.body.scrollHeight+4
var contentWidth=window.opera? collectWidth(frameObj.contentDocument) : frameObj.contentDocument? frameObj.contentDocument.documentElement.offsetWidth : frameObj.Document.body.scrollWidth
var frameWidth=frameObj.offsetWidth
if (window.opera&&frameWidth>=contentWidth)
frameObj.contentDocument.body.style.overflow='hidden'
frameObj.style.overflow='visible'
frameObj.height = frameWidth<contentWidth? contentHeight+18 : contentHeight+3;
}
}
</script>

Cyrandir
12-05-2005, 12:11 AM
This is great!! Thank you so much! It does work in Opera, as well as in IE and FF. I'm quite satisfied, and I'm indebted to you :)

Cyrandir
12-05-2005, 12:54 AM
Hello again,
Upon further investigation, I've found that in FF 1.07 the Iframe doesn't resize quite correctly. It resizes, but it just wrong enough to put horizontal and vertical scroll bars in. Seems to be only in 1.07, as all the 1.5 installations here work as intended. It's up at the same url if you want to check it. Any ideas?

jscheuer1
12-05-2005, 03:32 AM
Well, I just tested your page in NS7.2 (as well as FF1.0.7) and there is the same problem. I didn't have any problems like that in my demo testing. So, there may be a problem with your layout. If there is, it will probably be a very small dimension somewhere, probably a height. Rather than make you trace that down (as it is only what seems likely to me, might be a bug in my code) I'll tell you where in the script to make your own 'Mozilla' adjustment. Find this line and add the part shown in red:


var contentHeight=window.opera? frameObj.contentDocument.documentElement.offsetHeight : frameObj.contentDocument? frameObj.contentDocument.body.offsetHeight+13 : frameObj.Document.body.scrollHeight+4

That should more than take care of it. If not, make it a larger value but, I suspect that a smaller one may do, if you would, please experiment and let me know what the smallest value is that works for your layout. It will help me in development of the script.

Speaking of which, I discovered a glitch in Opera:

Since Opera does not by default count it as an onload event when its backward and forward buttons are clicked, it would be a good idea for Opera to use the the javascript 'location.replace' method when navigating links within the iframes and to the iframes. To that end, I've added quite a bit of Opera specific code. So, here's my current Opera mod without my above suggested change for your layout. The line where you make that adjustment is identical in this version as I mention above in the original (the beginning of said line is highlighted red in the below):


<script type="text/javascript">

/***********************************************
* IFrame SSI script III- © jscheuer1 (http://www.dynamicdrive.com/forums)
* very loosely based upon IFrame SSI script II- © DynamicDrive
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/

function collectWidth(obj){
var wVal=0
var objs=obj.document.getElementsByTagName('*')
for (var i_tem = 0; i_tem < objs.length; i_tem++){
wVal=Math.max(objs[i_tem].offsetWidth, wVal)
}
return wVal;
}

function setClicks(obj){
var links=obj.contentDocument.getElementsByTagName('a')
var iFrameObjs=document.getElementsByTagName('iframe')
for (var i_tem = 0; i_tem < links.length; i_tem++){
for (var j_tem = 0; j_tem < iFrameObjs.length; j_tem++)
if (links[i_tem].target==iFrameObjs[j_tem].name)
links[i_tem].onclick=new Function('parent.'+links[i_tem].target+'.location.replace(this.href);return false;')
else if (links[i_tem].target!=='')
links[i_tem].target=links[i_tem].target
else
links[i_tem].onclick=new Function('parent.'+obj.name+'.location.replace(this.href);return false;')
}
links=document.getElementsByTagName('a')
for (i_tem = 0; i_tem < links.length; i_tem++){
for (j_tem = 0; j_tem < iFrameObjs.length; j_tem++)
if (links[i_tem].target==iFrameObjs[j_tem].name)
links[i_tem].onclick=new Function('window.'+links[i_tem].target+'.location.replace(this.href);return false;')
}
}

function sizeFrame(frameObj){
if ((frameObj.contentDocument && (frameObj.contentDocument.body.offsetHeight||frameObj.contentDocument.documentElement.offsetHeight))||frameObj.Document && frameObj.Document.body.scrollHeight){
if (window.opera)
setClicks(frameObj)
var contentHeight=window.opera? frameObj.contentDocument.documentElement.offsetHeight : frameObj.contentDocument? frameObj.contentDocument.body.offsetHeight : frameObj.Document.body.scrollHeight+4
var contentWidth=window.opera? collectWidth(frameObj.contentDocument) : frameObj.contentDocument? frameObj.contentDocument.documentElement.offsetWidth : frameObj.Document.body.scrollWidth
var frameWidth=frameObj.offsetWidth
if (window.opera&&frameWidth>=contentWidth)
frameObj.contentDocument.body.style.overflow='hidden'
frameObj.style.overflow='visible'
frameObj.height = frameWidth<contentWidth? contentHeight+18 : contentHeight+3;
}
}
</script>

Cyrandir
12-05-2005, 06:03 AM
Looks good, thanks for the update. Ends up +13 was as low as I could go, hope that information helps, and it does seem to work better in opera in the conditions you discribed. Also, I went through and couldn't find any height variables that would have affected this frame, though do have some px heights set for other areas (graphics mostly). I will keep looking for whatever may be causing this for me, in case I missed something.

On a very very minor note, but worthy of documentation, the "onload" tag prevents the page from validating as any html doctype.

Cyrandir
12-05-2005, 05:51 PM
Not surprisingly, I'm finding the same error in NS 8.04. Which line should I edit to fix NS?

jscheuer1
12-05-2005, 08:02 PM
I don't have NS 8.04 and frankly, when I downloaded it, I didn't like the install interface (this was a while back) so I don't think I will be installing it. They (NS) must have changed their script engine fairly significantly though, because it used to be based closely on Mozilla. I have NS7.2 and it now renders your page correctly. I really think there may be a page design problem causing this but, still cannot be sure. I have a demo of the script that works flawlessly, as far as scrollbars not appearing for any of the browsers except occasionally a disabled vertical one in Opera or a horizontal one in all browsers whenever the content exceeds the width of the iframe. That actually may be the trouble. I noticed when I was playing with your layout that the width of the loaded content is very close to the width of the iframe. Once a horizontal scrollbar appears, it eats into the available height of the iframe for content, often making a vertical scrollbar necessary as well. On your style sheet (styles.css) the part that sets the content pages' width is here:


.textframe {
background-image: url(graphics/backgroupd.gif);
background-repeat: no-repeat;
background-color: rgb(204,204,153);
color:#0F482A;
font-family:Arial, Helvetica, sans-serif;
text-align:justify;
width:570px;
}

So, you have a few choices. Just to see if this is the problem, set it to like 545px. If that fixes it, increase the width until you find the upper limit. Also, you could set your iframe's width to be say, 580. Or whatever it would take to make it wide enough. One other consideration is that perhaps NS8.04 is not using the script at all. An iframe with scrollbars would be the default, if it isn't using the script.

As one other test, you can change this line (at the end of the script):


frameObj.height = frameWidth<contentWidth? contentHeight+18 : contentHeight+3;


The values in red, one or the other of them may need to be increased. If you cannot fix it for NS8.04 by using this strategy, then NS8.04 either isn't using the script or is doing so in a way NS never has before, probably ignoring or finding error in code it previously accepted.

jscheuer1
12-06-2005, 12:42 PM
Well, what do you know? I went back and installed NS8.04 and its not so bad as I remembered it though a bit obnoxious with the added software partners they have it so you need to opt out rather than in for. I had also been worried about losing NS7.2 but , I was able to do a separate install and keep both versions. Anyways, 8.04 has three 'rendering' engines. The only one that didn't work with your page was the 'untrusted' method (which the documentation states will have rendering problems on many sites). Your page looked fine in 8.04 using either the 'trusted' or the 'not sure' rendering modes. Have you already updated the code, or was it just that you were in untrusted mode? If you made an update, what was it?

pocaatje
01-06-2006, 11:18 AM
Hi i have some little problems with opera and firefox

http://www.ad.nl/ad.nl/iframe.html

Opera: If i have too much content on the second iframe then i have a weird black space at the bottom.

Firefox: Here i have a scrollbar that i don't wanna have. And here i get with too much content weird things at the bottom white space and hanging of text.

Can someone help me with this problem. I have tried everything i can find at this forum but nothing seem too work.

corbinb2
01-06-2006, 04:26 PM
Important note about using this script and Firefox....

The content of the page being inserted (iframe src) cannot use tables. If it does Firefox will not display properly and will have scroll bars. I did a few days worth of research and came across mention in this forum about tables not being a good idea, and decided to pursue that further.

Once I changed my iframe src page content to text/graphic only format, it popped it in perfectly with Firefox and auto-resized the way the script should. This prob does help you if your iframe src page needs to use tables, but this will help most that I have seen on this forum having FF problems with this script.

Notes...

With the style display attribute set to visible or auto, FF will temporarily show scroll bars which will disappear once the page is full loaded. You can stop this by setting the style display attribute to hidden.

Such a simple solution....Hope this helps everyone who was having FF issues with this script.

andrewcb
02-13-2006, 03:16 PM
Hi all,
my first time in here, so please be gentle with me :)

I have just implemented the script from
http://www.dynamicdrive.com/dynamicindex17/iframessi2.htm

I need the script to dynamically resize the height to fit the dynamic conent.

I manged to get rid of the scrollbars in firefox by fiddling with the :

var FFextraHeight=parseFloat(getFFVersion)>=0.1? 26 : 10 //extra height in px to add to iframe in FireFox 1.0+ browsers

line but it would be great if I could get the window to display properly in opera as well.

Any help greatly appeciated.

jscheuer1
02-13-2006, 04:00 PM
PLEASE: Include the URL to your problematic webpage that you want help with.

andrewcb
02-13-2006, 04:30 PM
Hi there Mad Professor,
sorry it's 3.30am here and mi brayn iznt workin proper.
the URL for the site is http://www.earthquake-news.net

jscheuer1
02-13-2006, 06:15 PM
Don't feel bad, if I was really thinking, I would have told you that script isn't rated for Opera. Here is a demo (http://home.comcast.net/~jscheuer1/side/iframe_ssi_III_demo.htm) of one that is. The server is a bit slow though, so if you are having problems with it, copy the source and try it out on your page.

andrewcb
02-14-2006, 02:30 AM
Hiya John,
I've just implemented the code on that link you mention above, which has fixed the opera problem but now the firefox problem has crept back in.

Is there anyway to include that line for the previous version that allows to add a few extra pixels to the height so that you dont get any scroll bars in firefox.

The code was:
var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 26 : 10 //extra height in px to add to iframe in FireFox 1.0+ browsers

I've got your updated code implemented on this test page:
http://www.earthquake-news.net/new2.php

Thanks again for any help.
:D

jscheuer1
02-14-2006, 05:01 AM
I already included such a feature in my script for just such a purpose. You will see, at the beginning of the script this one and only one configuration option:


//Set optional Mozilla (recent FF, NS and other Mozilla based browsers)
//height adjustment if needed for your layout to avoid scrollbars.
//example: var mAdjust=14
var mAdjust=0

The green part is just a comment/instructions. It is the red number 0 that you can adjust. Try 14. For some reason, those layouts which needed this liked 14. It is at least a good starting point. You can use whatever number you need. But, just for your information, there should be a way to lay out the page where it doesn't need this adjustment. Specifically using the iframe inside a table with a set percentage height can become rather confusing to FF. Other layouts might, under some circumstances, prove equally challenging to FF. Just something to think about and play with if you are so inclined. By all means use the adjustment if it takes care of the scrollbar.

andrewcb
02-14-2006, 05:43 AM
John, I'd kiss you but people might talk

thanks Big time.
I've got an intermittant scroll bar appearing where the map appears in opera, but disappears when you click on the link to load in the other map and then back again.. I wish these browser folks would all get together for a big love in.

Anyway I can live with the opera problem.

again a very big THANKYOU.

jscheuer1
02-14-2006, 05:59 AM
It might help to use scrolling="no" in your iframe tag:


<iframe name="I2" scrolling="no" onload="sizeFrame(this)" src="eqnews.php" marginwidth="20" marginheight="0" frameborder="0" vspace="0" hspace="0" height="350" width="580"></iframe>

and/or overflow:hidden for the td containing the flash:


<td bgcolor="#CE1F00" align="center" style="overflow:hidden;"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="598" height="14">
<param name=movie value="gmt2a.swf?timestamp=1139896360787">
<param name=menu value=false>
<param name=quality value=high>
<param name=bgcolor value=#CE1F00>
<embed src="gmt2a.swf?timestamp=1139896360787" menu=false quality=high bgcolor=#CE1F00 width="598" height="14"
type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
</embed>
</object></td>

andrewcb
02-14-2006, 07:10 AM
Hiya again John,
I did actually have scrolling=no set on both iframes, the : style="overflow:hidden;" hit the nail on the head and now the page looks the same any any of the 3 browsers.

thanks again.

andrewcb
02-16-2006, 12:37 PM
Hi John,
back again.

I've noticed when looking at the http://earthquake-news.net/ page in internet explorer, if you click on either the load 'todays earthquake map link', or the 'last 7 days earthquake map' link for some reason it's generating a javascript error warning, if you look in the bottom left hand corner it's displaying one of those little yellow error pyramids.
the error is saying:
error on page:

line: 86
char: 1
error: Permission denied
Code:0
URL: http://earthquake-news.net

Any ideas?
the code is as I mentioned before working fine in all 3 browsers, it just bugs me seeing that error there.

Andrew

andrewcb
02-16-2006, 12:45 PM
Hi John,
I simply edited the url to on both of those text links so that they are just the page ie: 1dat.php rather than the full url for the page and it fixed the problem.

Andrew

webshop
02-24-2006, 04:30 PM
Hi,

I'm developing a site with a flash audio player at the bottom of the page. Off course I can't put the player in my footer (witch refreshes on every click) otherwise the music stops.
I've tried the IFrame SSI script III and it seems everything is working fine (except for SAFARI off course). Now the thing is that I don't like to display my entire site except for the audio player in an iframe. People with browsers that don't display iframes couldn't view my site.
By using this script I also see problems with my background because I had to load my background image in both iframes and the .html document...

Therefore I'm now looking for another solution instead of using iframes for my problem. :confused:

Here (http://www.shopkaput.com/usability/example.jpg) you can see a picture of the site Iím developing right now!


Any help would be really appreciated!!

Gijs

andrewcb
02-26-2006, 05:08 AM
Hi there Webshop,
I don’t know if you've solved this problem yet, but I may have a solution for you.
It's a bit lateral, but how about this.
When the page is opened it automatically spawns opening another browser window.
The original page has the flash player in it; the spawned page has flash/JavaScript controllers in them that communicate with the original page that was opened.
That way the browser window that has been opened on top can have whatever content loaded in it without it affecting the music playback.
And you will be able to control the playback of the flash music files.

webshop
03-01-2006, 10:16 AM
Thanks andre,

I've tried your solution but it did not work out well for me. I did some tweaking to your script and my pages and now they work the way I want them to work.

I've tried it on loads of computers (pc and mac) and different browsers (IE FF and safari)

Now with this script the only problem is Safari and firefox on pc, these bowsers don't adjust the height of the iframe so my page is way to long (under my flash player) when i go to a page with litle content after i visited a page with lots of content. Is there any solution that will make safari adjust and FF for PCthe height of the iframe?

I use 1 iframe for the content and i put my flash player just in a table below the iframe:


<table style="height:100%; width:100%;">
<tr>
<td>
<iframe onload="sizeFrame(this)" name="target" id="target" src="../../../front/index.php" width="100%" frameborder="0" marginheight="0" marginwidth="0" vspace="0" hspace="0" scrolling="no" allowtransparency="true">
</iframe>
</td>
</tr>
<tr style="width:100%; height:100%;">
<td><div align="center">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="770" height="70">
<param name="movie" value="nieuw_player.swf" />
<param name="quality" value="high" />
<embed src="nieuw_player.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="770" height="70"></embed></object>
</div></td>
</tr>
</table>

Now the other problem i just figured out: For my shop I use a SSL connection in some areas, now the user can't see the lock in their browser because the html file with the iframe in it is not connected thru SSL... what can i do? Just let the flash player pop up in a new window? looks like this is the best solution for me...

Thanks a lot!

Gijs

skinnybonez
08-24-2006, 04:25 PM
hey. i noticed that this thread hasn't been going for a while...so, sorry to bother you.

first, i'm on a mac and i'm creating a site and am having some problems with this script (the new version no. 3 posted in this thread). so far, i have only tested this on safari and am trying to make it work in firefox 1.5.0.4.

here's the link:
http://www.adimer.net/dev

(ignore the flash navigation at the top, i am planning to make integrate this later once i get the iframe working). i have placed 2 temp links for testing the iframe 'mission' and 'strategy' that load the content into the iframe. it works great in safari...but, for some reason the content is being cut off to the default height of the dynamic iframe of 450pixels tall. the content pages i am trying to do completely in css, however, the 'strategy' page being loaded is done with a table.

any advice would be GREATLY appreciated.

jscheuer1
08-25-2006, 04:44 AM
Works fine here in FF 1.5.0.6

sommer
09-01-2006, 10:42 PM
Hi!

I try to use the "Iframe SSI Script II" but I have the same problem like other users related in this topic.

So, after searching and spending a long time on the web, i found this script that works correctlly in IE and FF:

<script type="text/javascript">
<!--
moz=document.getElementById&&!document.all
mozHeightOffset=20
function resize_iframe(){
document.getElementById("ID_IFRAME").height=100
document.getElementById('ID_IFRAME').height=window.frames["NAME_IFRAME"].document.body.scrollHeight+(moz?mozHeightOffset:0)
}
// -->
</script>

<iframe width=500 id="ID_IFRAME" name="NAME_IFRAME" src="page.asp" scrolling="no" frameborder="0" onload="resize_iframe()"></iframe>

But, a friend told me that script not works correctlly in the new IE7 beta
So, I don't know if this problem is in the script or in the new IE, considering the fact of this version is beta.

I using this script for a long time in IE6 and FF and never see problems...
My actual problem is in IE7 beta...but not only in IE or FF , I need a solution for a cross-browser!

Nobody haves a solution for this case?

Thanks a lot for attention !!!
Cheers!

kiwipaul
08-17-2011, 10:46 PM
Hi John, your very elegant rewrite of Iframe SSI Script II at: http://www.dynamicdrive.com/forums/showthread.php?t=5060&page=2
allows me to achieve exactly what I want on my site www.jobsdirectly.com

However this is now broken in IE8 as detailed at:
http://www.dynamicdrive.com/forums/showthread.php?t=44718

I have been able to fix by using:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">

I'm wondering if you would consider updating your script to make it IE8 compatible?
If so I would be most grateful.
Best regards
Paul Royse
Auckland
New Zealand

jscheuer1
08-18-2011, 02:45 AM
Believe it or not - best I can tell, you're not using my script for that. The search results are hosted on Google's servers. My script cannot function on an iframe with content from another domain. You should go over the Google Custom Search Docs, and/or ask Google and/or ask in a support forum for their custom search. If it's any consolation, I checked in IE 9 and it appears to work in it. Now if there were a way to only emulate IE 7 if the version is IE 8, mmmm.

My advice would be to use the IE 7 emulation for now, until Google works this out, or you find an answer from them, their docs or a forum.

In any case, I'm no longer supporting that script. Like the one I tried to improve upon, it has too many quirks to be widely applicable.

Oh, and that forum you linked to (ofcwarecenter) - it appears to be an unofficial clone of this forum. Best not to use it. Make sure:

http://www.dynamicdrive.com/forums/

is showing in the address bar when logging in. Otherwise your personal information may be compromised.

kiwipaul
08-18-2011, 04:18 AM
Hi John

Thanks for your prompt reply.

Yep I am using your script and it works a treat! On jobsdirectly.com it loads a dynamic menu (trigger.htm) in the lefthand side into an iframe directly beneath the words "Favourite Searches". If you click on one of the two choices in trigger.htm, ie "Gold Coast" it loads another dynamic menu (locations_list.htm) into the Contents div, beneath "Employer only job searches across Australia" Clicking one of the links in locations_list.htm then replaces this menu with another file, ie 41054.php.

All the Google Custom Search stuff seamlessly wraps around that dynamic content.

However I completely understand you're not intersted in maintaining the code and will either make do with IE7 emulation, or try and work out the fixes myself.

Paul
kiwipaul

jscheuer1
08-18-2011, 06:29 AM
I didn't notice any problems in IE 8 for that stuff (not saying there isn't, I just didn't notice, for me the menu in the triggers iframe was always the same, listing at least around 10 categories). All I noticed was that the search results were cut off at the bottom leaving the:


prev 1 2 3 4 5 . . . next

navigation within the results either truncated at the bottom or completely unseen.

kiwipaul
08-18-2011, 03:11 PM
Hi John, my triggers iframe currently correctly loads just 2x menu items (i: Gold Coast, ii: Mornington Penninsular & Bass Coast). Below these the "Popular Category Searches" and 14x Google Custom Search URL's are not part of the triggers iframe. This Google stuff is sitting underneath the triggers iframe.

I am using IE8 and in the demo (jobsdirectly.com/index.html) the IE7 emulation is turned on.

Without that IE7 emulation the <destination iframe name="I5" ... > does not correctly expand within the <div id="content"> when "locations_list.htm" is loaded.

I've loaded a demo page without IE7 emulation: http://www.jobsdirectly.com/NotIE7.html

In this demo, if you click on Gold Coast in the left sidebar it should correctly load "locations_list.htm" into "I5" and "I5" should further expand as you click on either of the 2x links in "locations_list.htm".

However without IE7 emulation present "I5" does not correctly expand based on the content, presumably because of the problem outlined in:
http://www.dynamicdrive.com/forums/showthread.php?t=44718

Cheers, Paul

jscheuer1
08-18-2011, 04:56 PM
OK, well it seems to work in IE 9 IE 9 standards. So if I understand what they're saying in that thread, I'd try a browser specific fix for IE 8. To do so, replace:


function sizeFrame(frameObj){
if ((frameObj.contentDocument && (frameObj.contentDocument.body.offsetHeight||frameObj.contentDocument.documentElement.offsetHeight))||frameObj.Document && frameObj.Document.body.scrollHeight){
if (window.opera)
setClicks(frameObj)
var contentHeight=window.opera? frameObj.contentDocument.documentElement.offsetHeight : frameObj.contentDocument? frameObj.contentDocument.body.offsetHeight+mAdjust : frameObj.Document.body.scrollHeight+4
var contentWidth=window.opera? collectWidth(frameObj.contentDocument) : frameObj.contentDocument? frameObj.contentDocument.documentElement.offsetWidth : frameObj.Document.body.scrollWidth
var frameWidth=frameObj.offsetWidth
if(!window.opera)
frameObj.style.overflow='visible'
frameObj.height = frameWidth<contentWidth? contentHeight+18 : contentHeight+3;
if (window.opera&&frameWidth>=contentWidth)
frameObj.contentDocument.body.style.overflow='hidden'
}
}

with (addition highlighted):


function sizeFrame(frameObj){
if ((frameObj.contentDocument && (frameObj.contentDocument.body.offsetHeight||frameObj.contentDocument.documentElement.offsetHeight))||frameObj.Document && frameObj.Document.body.scrollHeight){
if (window.opera)
setClicks(frameObj)
/*@cc_on @*/
/*@if(@_jscript_version >= 5)
if(/MSIE 8.0/.test(navigator.userAgent)){
var contentHeight=frameObj.Document.body.scrollHeight+4;
} else
@end @*/
var contentHeight=window.opera? frameObj.contentDocument.documentElement.offsetHeight : frameObj.contentDocument? frameObj.contentDocument.body.offsetHeight+mAdjust : frameObj.Document.body.scrollHeight+4
var contentWidth=window.opera? collectWidth(frameObj.contentDocument) : frameObj.contentDocument? frameObj.contentDocument.documentElement.offsetWidth : frameObj.Document.body.scrollWidth
var frameWidth=frameObj.offsetWidth
if(!window.opera)
frameObj.style.overflow='visible'
frameObj.height = frameWidth<contentWidth? contentHeight+18 : contentHeight+3;
if (window.opera&&frameWidth>=contentWidth)
frameObj.contentDocument.body.style.overflow='hidden'
}
}

This assumes that what was said in that thread (6th post):


The problem is that the script checks for currentfr.contentDocument.body.offsetHeight and uses that if present, falling back on currentfr.Document.body.scrollHeight for IE. IE8 adds support for contentDocument, but misreports currentfr.contentDocument.body.offsetHeight as the height of the iframe window not the document body.

is correct.

Which appears to be the case because after pasting the new function into IE 8's developer console it worked.

kiwipaul
08-18-2011, 08:31 PM
Hi John

You rock - that works a treat, http://www.jobsdirectly.com/NotIE7.html is now all good.

Thanks so much for this, also I will get a copy of IE9 and and check out performance of the Google stuff.

Thanks again!
Paul

jscheuer1
08-18-2011, 11:38 PM
The problem wasn't with IE 9. It's in IE 8 and 7. One can observe it in IE 9's IE 8 and 7 modes. But it's also evident in the real IE 8 and 7. It doesn't happen with all of the Google stuff. I haven't checked them all, but the very first one:

Accountant Vacancies in Real Estate

When it loads up in IE 8 or 7, the numbered navigation at the bottom isn't there.