Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 30th, 2006, 02:27 AM
Registered User
Join Date: Oct 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default IFrame and the contextmenu

Hello All,

I have some problem with iframe...

<iframe id="myframe" src="http://www.google.co.in/" scrolling="no" marginwidth="0"

marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100%;

display:none"> </iframe>

I added this iframe in other web project. Now problem is i want to set iframe height dynamically

as per it's content. i wrote jscript for that..but it give me Access Denied Error.on below blue

color line.

function iFrameHeight() {
var h = 0;
if ( !document.all ) {
h = document.getElementById('iframe').contentDocument. height;
document.getElementById('iframe').style.height = h + 70 + 'px';
} else if( document.all ) {
h = document.frames('iframe').document.body.scrollHeig ht;
document.all.iframe.style.height = h + 30 + 'px';

finally i found that ..if you have the iframe's document from a different source to your main

page then you will be Access denied error.

But i Need Strictly do that .. i want to give diffrent source to iframe and also set dynaicall

height of iframe as per it's content.

How can i do that ? Please give me the solution for that.. or if you know any idea of paid

control for that please suggest me.

thanx in advance..

Harshad Patel
Old October 30th, 2006, 05:21 AM
joefawcett's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts

You might be able to do it by lowering security settings for the main page's zone but that can't be done programmatically, you'd need to visit each machine or use something like Group Policy if the machines are on the same domain.
On the other hand you can set the height of the actual frame, you just can't read information about the current document so you may be able to think of a workaround, what exactly are you trying to achieve?


Joe (Microsoft MVP - XML)
Old October 31st, 2006, 02:10 AM
Registered User
Join Date: Oct 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts

Thanx for your repaly..

Basically i don't need iframe scrollbar. i have one default.aspx page in that page top pane (Image) , contentpane , bottom pane (copy right etc).

Now in content pane my iframe is loaded that is diffrent source (http://localhost/DotNetNuke/Default.aspx")

My both source is configured in same domin or machine.

Please see this url for more idea.. http://wb.ibsgi.com/
here you can see iframe scroll bar. I want to remove it and need just one scroll bar of main window or ie.

As per your security suggestion How i set low security settings ?

thanx for you appreciate replay.


Similar Threads
Thread Thread Starter Forum Replies Last Post
ContextMenu obrienkev Visual Studio 2005 1 November 30th, 2007 03:21 AM
Page 370 - New ContextMenu MajorD BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 2 July 25th, 2007 10:26 AM
values from one iframe to another iframe URGENT raaj Beginning PHP 2 February 27th, 2007 12:19 PM
IFrame and the contextmenu harshad Javascript 1 November 1st, 2006 02:20 AM
IFrame and the contextmenu sherbir Javascript 6 April 28th, 2006 01:48 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.