PDA

View Full Version : Iframe SSI script II issues in Windows Vista



rsimmons
02-23-2009, 10:40 PM
1) Script Title: Iframe SSI script II issues in Windows Vista

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

3) Describe problem:This script functions correctly in IE 7.0.5 and FF 3.0.6 running Windows XP OS. When this script is accessed in IE 7.0.5 and FF 3.0.6 running Windows Vista, the iframe functions the same as an iframe with a scroll bar to the right of the iframe. Anyone having this issue?

GaryN
02-24-2009, 05:06 PM
I wonder if this is the same issue as mine?

http://www.dynamicdrive.com/forums/showthread.php?t=42157

I haven't tried it under XP but then, why should the OS make any difference?

Does yours work okay with IE8 as well?

rsimmons
02-24-2009, 06:38 PM
Haven't tried it with IE8. I'm going to download IE8 and test. I have tested the script on 2 computers running Vista and both produce the same results - auto resizing does not function. I get a scroll bar in FF3 and no scroll bar in IE7.

GaryN
02-24-2009, 07:28 PM
The strange issue is that I get the same fault in FF3 on my site but it works fine on the dynamicdrive site.

In FF3 I get the iFrame with a vertical scrollbar (non-expanded). In IE8 it all works. Yet in both IE8 and FF3 the example version works fine.

I wonder if it is related to addressing? I have the script on a PHP page, which is then called into the header for each page.

I have fixed the PHP include with an absolute address but this did nothing at all.

Lost, very lost. :(

rsimmons
02-25-2009, 02:28 PM
It functions correctly with a HTML page in IE7 and FF3 running XP. I was hoping the author of the script might reply. This script was written or updated in 2005 for IE5 and FF1. And there was no Vista OS available. Very strange about Vista.

maestro76
03-05-2009, 11:53 PM
Just thought I would fill you in on my experience with the iframe ssi resize script. Maybe some of this should go into the configuration info.
The script will not work on an iframe with a php source. It will work for html src files.

So I thought really hard about it and came up with the following solution: (this is assuming the page are local)

This code will go on the iframe src page in the header.


<script type="text/javascript">
function iframeresize()
{
var divh = document.getElementById('top').offsetHeight;
parent.document.getElementById('targetframe').style.height = divh+10+'px';
}
</script>

This code will be in the iframe src page body tag


<body onload="iframeresize()">

On the iframe src page you will need to wrap the entire page content in a div tag with an id, I used top.

On the parent page your iframe tag will look like this


<iframe src="include/new_input.php" name="targetframe" id="targetframe" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:700px; height:600px;"></iframe>

Then to change the iframe source from a link, I use this script which I got from dyn-web.com:

Put this on the parent page

<script type="text/javascript">
// <![CDATA[

/* Free code from dyn-web.com */

function changeIframeSrc(id, url) {
if (!document.getElementById) return;
var el = document.getElementById(id);
if (el && el.src) {
el.src = url;
return false;
}
return true;
}
// ]]>
</script>

Your links will look like this:

<a href="new_input.php" onclick="return changeIframeSrc('targetframe', this.href)">


So basically the first function will get the height of the div from the iframe, then it will change the height value of the style for the iframe on the top page to be the same height as the div on the iframe. I add another 10px just to be sure.


Then the other script just makes it so that links will target the iframe. As long as you have the first function and the onload in the body tag of the new src for the iframe it will resize it every time. If you have questions let me know.

rsimmons
03-25-2009, 10:50 PM
Tried the code from the last post. It still will not work on Vista. Strange.

maestro76
03-25-2009, 11:32 PM
I run vista and it works great for me. Post your code so we can see what you are doing.

lagisetti
04-28-2010, 06:01 AM
Hi maestro76,

I also have the same problem with below script in vista.
"parent.document.getElementById('threedcontinue').click()"

<button id="threedcontinue" type="submit"/>

Please let me know if you updated your vista os with any service packs.

Thanks in advance,
Rama Krishna