473,386 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Calculate height of iframe problem in asp page with external link

I use an asp page to display pages, where the dynamic content is in an
iframe.
To calculate the height of the iframe I use the calcheight function. However
when trying to do this with external pages, I get an access denied error,
and the iframe won't display correctly.
Is there a way to solve this or another way to calculate the height for the
iframe.
The relevant code displayed below.

Thanks in advance for any help,
Robert
function for calculating the height of the iframe:

function calcHeight()
{
//calculate height
var the_height=
document.getElementById('hoofdframe').contentWindo w.
document.body.scrollHeight;

//minimal height of 600
if (the_height < 600) {the_height=600}

//change height
document.getElementById('hoofdframe').height=
the_height;
}
the iframe:

<iframe name="hoofdframe" id="hoofdframe" width="630" onload="calcHeight();"
src="<%=session("urlsessie")%>" scrolling="no" height="1"
frameborder="0"></iframe>

Nov 7 '05 #1
1 2672
VK

Robert de Ridder wrote:
I use an asp page to display pages, where the dynamic content is in an
iframe.
To calculate the height of the iframe I use the calcheight function. However
when trying to do this with external pages, I get an access denied error,
and the iframe won't display correctly.
Is there a way to solve this or another way to calculate the height for the
iframe.


You cannot change security while acting from the top to the bottom
(from your parent document to your iframe). Otherwise what kind of
security would it be?

If you are dealing with documents from the same domain, you can use
IE-only (?) document.domain property.

So if in *both* documents (parent one and in iframe) you have:
....
document.domain = "myserver.com";
....
then security communication block will be removed for all documents
served either from "http://www.myserver.com" or
"http://subdomain.myserver.com" and so on.

If your documents are from totally different domains then you have
either
1. Kill security settings on each computer
2. Have a script in each document served to iframe so it would *itself*
report to its parent the needed info.

I would definitely stay on the 2nd option.
:-)

Nov 7 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: coolsti | last post by:
I need some help here. I am making an application which allows a user to look at a series of picture files one at a time, and enter the outcome of various visual tests to a database. The...
24
by: ej1002 | last post by:
Hi I have developed a Windows Application(C# Windows Form) which will get the IFrame Source of the page it is navigating using Webbrowser Control. Now I want do this in ASP.Net web application(C#...
1
by: Steve Richter | last post by:
I have a simple table with two columns. The first column contains 5 lines of text. The second column contains an iFrame. The iFrame in turn contains a web page. The problem is it does not...
26
by: shlomi.schwartz | last post by:
using this example: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Test Page</title> </head>
2
by: jerryyang_la1 | last post by:
Hi I'm trying to make an Iframe height adjustable depending on the height of the web page. I have managed to get this to work for the width, but not the height. The original code is available...
1
by: knkk | last post by:
Hi, I have an iframe that fetches content from a different domain. This is my URL, which has an iframe that fetches content from another site careerbuilder.co.in (this is a partnership channel, so...
1
by: soms2m | last post by:
HELLO ALL, I want to fill the parent window height with respect to the sub window height which is loading using ajax (mootools). For example if the parent window height is normal and the loading...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.