it is getting truncated at XXXXXXXX. (the XXXXXXXX is not in the comment, it's just a marker to show you where it's getting truncated.) everything after the XXXXXXXX is not displayed.
here is the blog which is experiencing this problem:
http://scvdotnet.org/index.php?/archive ... Frame.html
First off, thanks a ton! I have been trying to find a solution for days.
I did want to raise one issue (which I resolve below). Cross domain security issues will still arise if a user access your site with http://somedomain.com/parentPage.htm, and your child page uses loadHiddenIframe("http://www.somedomain.com/hiddeniframe.html");, or vice-versa.
To resolve this, here is what I came up with (in 3 steps):
1- CHANGE resize.js to the following:
function QueryString(key)
{
var value = null;
f[/color]or (var i=0;iXXXXXXXX<QueryString.keys.length;i++)
{
if (QueryString.keys==key)
{
value = QueryString.values;
break;
}
}
return value;
}
QueryString.keys = new Array();
QueryString.values = new Array();
function QueryString_Parse()
{
var query = window.location.search.substring(1);
var pairs = query.split("&");
for (var i=0;i<pairs.length;i++)
{
var pos = pairs.indexOf('=');
if (pos >= 0)
{
var argname = pairs.substring(0,pos);
var value = pairs.substring(pos+1);
QueryString.keys[QueryString.keys.length] = argname;
QueryString.values[QueryString.values.length] = value;
}
}
}
QueryString_Parse();
function loadHiddenIframe(path, retryPath) {
var height = Math.max( document.body.offsetHeight, document.body.scrollHeight );
height = height +30;
var iframe = document.getElementById( 'HiddenIframe' );
iframe.src = path + '?height=' + height + '&retryURL=' + retryPath;
}
function resizeIframe(height) {
try{
//this will fail if they are in a different domain
//or, if http://somedomain.com is trying to access http://www.somedomain.com
var iframe = window.top.document.getElementById( "surveyFrame");
iframe.setAttribute( "height", height );
return true;
}catch(e)
{
return false;
}
}
2- Change hiddeniframe.html to the following:
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript">
//get the height of the survey, passed to me by the survey, in my url
var height = QueryString("height");
//call a function in the domain which hosts the survey. since it's the host page of the survey, it is able to resize the iFrame.
if (!resizeIframe(height))
{
if (QueryString("retryURL") != "") location.href = QueryString("retryURL") + "?height=" + height;
}
</script>
3- Change loadHiddenIframe call in the child/remote page to the following:
loadHiddenIframe("http://www.somedomain.com/hiddeniframe.html", "http://somedomain.com/hiddeniframe.html");
Now, this is what I came up with. I realize that it could probably be improved. The point here is that we do need to account for users entering the site without the "www.". I have tested this, and it seems to be working well. I look forward to your feedback.