473,804 Members | 2,673 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

changing Iframe's height from itself ..

Hi ,
I am using a cross domain iframe in my page..
If i want to change the iframe height a/c to its content height , its
giving Permission denied error as i am trying to access a function,
which changes an iframe's height, in the parent window ...
So Is there any way to change its height from the iframe
itself???????
Plz help me out in this case ..........
Thanx in advance........ ..........

Nov 6 '06 #1
3 2628
Prasad wrote:
So Is there any way to change its height from the iframe
itself???????
As said (in de.comp.lang.ja vascript), for IE/Win you can use
window.resizeTo (someWidth, someHeight)
even on iframe window objects and it will resize the iframe. As for
getting the document height, look into the function you already have, it
is simply a question of accessing the right document properties e.g.
window.resizeTo (document.docum entElement.offs etWidth,
document.docume ntElement.scrol lHeight);
where the only problem is that depending on the IE version and the
rendering mode you need to access document.docume ntElement or document.body.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Nov 6 '06 #2

Martin Honnen wrote:
Prasad wrote:
So Is there any way to change its height from the iframe
itself???????

As said (in de.comp.lang.ja vascript), for IE/Win you can use
window.resizeTo (someWidth, someHeight)
even on iframe window objects and it will resize the iframe. As for
getting the document height, look into the function you already have, it
is simply a question of accessing the right document properties e.g.
window.resizeTo (document.docum entElement.offs etWidth,
document.docume ntElement.scrol lHeight);
I am using a function ...........

function changeHeight()
{
//
window.resizeTo document.docume ntElement.offse tWidth,document .documentElemen t.scrollHeight) ;

// window.resizeTo (200,400);
window.resizeTo (document.docum entElement.offs etWidth,documen t.body.scrollHe ight);
setTimeout("cha ngeHeight()",10 00);
}
its first time called when iframe body is loaded ..
But its behaving very wierd .. the height of the iframe is increasing
and decreasing to some arbitrary value and after some time, an error
that "Access is denied " is being displayed ...

this iframe's domain is different from the parent's domain .....(but i
dont guess its a problem ..)

And i tested this function with a sample iframe in the same domain ..
its working fine... ( )
what could be the problem in the first case ??


where the only problem is that depending on the IE version and the
rendering mode you need to access document.docume ntElement or document.body.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Nov 7 '06 #3
Hi!

In order to prevent cross-domain security problems, browsers enforce
the so-called "same origin policy" in the javascript object model,
making it impossible to access the iFrame and its properties whenever
it stems from another domain. So, as far as I know, what you want is
impossible. I'd certainly love to hear the opposite though!

Best regards,
- Alex.

On 6 Nov 2006 02:36:53 -0800, "Prasad" <pr*******@gmai l.comwrote:
>Hi ,
I am using a cross domain iframe in my page..
If i want to change the iframe height a/c to its content height , its
giving Permission denied error as i am trying to access a function,
which changes an iframe's height, in the parent window ...
So Is there any way to change its height from the iframe
itself?????? ?
Plz help me out in this case ..........
Thanx in advance........ ..........
Nov 7 '06 #4

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

Similar topics

3
9307
by: Catherine Lynn Smith | last post by:
I want to know the recommended way to handle scripting of/with containers such as an iframe. I have a page with border-navigation bars on the top/bottom/left/right and I want to use an iframe to load content in the middle. I would like, if possible, to have the parent window resize itself to suit whatever is loaded into the iframe container, deriving the size needed from calculated values. Thus the calculation would have to over-ride...
3
8134
by: Russell | last post by:
I have a quirky issue that I believe involves timing and only 2 hairs left to pull. I have a modal dialog that is an IFrame. The IFrame contains another window - which contains the appropriate title. I am trying to change the title of the IFrame window to be that of the contained window title. If I uncomment the alert statement below - the title change works. Comment out the alert - and - no title change.
1
2695
by: Robert de Ridder | last post by:
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,
1
4533
by: rbinington | last post by:
Hi, I am trying to write a DNN module that has the ability to insert articles into an article repository. I want the users to be able to move pages around and enter text into the FCKEditor. I want only one instance of the FCKEditor on the screen at one time so I make tabs that the user can click and I store the values in variables behind the scenes. I change the CSS class on the link that is the currently selected one. I have a really...
3
7357
by: bulldog8 | last post by:
I am having problems with changing a frames source file for Mozilla (1.5.0.4). The followig code works for IE: <script type="text/javascript"> var imgP = new Image(); function ShowPic(ShowThis, wdth, hght) { imgP.src = "../pics/' + ShowThis + '" xw = 500; yh = 500*(hght/wdth); window.document.getElementById("graphic").innerHTML = '<img src="../
0
7778
by: tequilamala | last post by:
I have an Iframe in one of the pages i am developing... the iframe is suppose to scroll up and down and the links target the iframe. the problem is that the iframe scrolls side to side on internet explorer but not on firefox. I dont want it to scroll sideways. in index.htm the iframe is at the bottom of the code. index.htm <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">...
1
8138
by: Z1P2 | last post by:
I would like to gradually resize an iframe in an onmouseover event. I can easily do it with an image, but when I try to do it with an iframe, it doesn't do anything. So first of all, is it possible to gradually zoom an iframe, and if so, what am I missing? Here is the script I am trying to manipulate, between the head tags: <script language=JavaScript> /**** adjust these two parameters to control how fast or slow
0
9577
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10315
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10075
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9140
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7615
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4295
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.