Solved

Changing Iframe Heigh (URGENT)

Posted on 2006-11-13
10
233 Views
Last Modified: 2008-01-09
I have this Application and I can my web applications inside it as tools. But once the application is deployed It appears as an iframe.
Since my  was not written to run as an iframe so  but now since its deployed in another application client side pages of my application run as an Iframe.
Now since I never declared any ifram so there is no iframe id. I can refer to the parent window though.
My problem is that I want to change the height of iframe my application appears in within that large application.  how can change that since i dont have the iframe id
but i can refer to the parent window.
Its really an SOS type issue right now
0
Comment
Question by:mostenscer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
10 Comments
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 17933030
mostenscer,

Does the iframe have a name?  Is it the only iframe?  You could try one of the options below.

parent.framename.height = '200px';

OR

parent.frames[0].height = '200px';

OR

parent.frames("framename").height = '200px';

Let me know if you have any questions or need more information.

b0lsc0tt
0
 
LVL 8

Expert Comment

by:netmunky
ID: 17933072
assuming there are no other iframes, try parent.getElementsByTagName('IFRAME')[0].setAttribute('height', 100);
0
 
LVL 2

Author Comment

by:mostenscer
ID: 17933233
no it doesnt have a name coz i never created my pages as frames they were adapted by the preant application as frames . so NO
and there are other frames as well.
Now what i am thinking abt  is getting the listen of iframes from the parents {i dont know how though please help} and try with each one of them? please
shun me here if i am wring  
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 8

Expert Comment

by:netmunky
ID: 17933246
getElementsByTagName('IFRAME') will return an array with all of the iframes
0
 
LVL 2

Author Comment

by:mostenscer
ID: 17933291
and how do iterate through that array? there are atmost 4 frames and how how do i set the height to 80% or so one by one to see which is the one i am looking for
I am sorry  but i really need to get this done and i am not javascript developer:(
0
 
LVL 54

Assisted Solution

by:b0lsc0tt
b0lsc0tt earned 200 total points
ID: 17933356
What is the domain of the iframe content page and the page that holds the iframe (i.e. main page)?  If they are different the browser will not allow you to change the height of the iframe in the main window with a function in the content page.  Security restrictions since the domains are different.  What you have described makes me think this is the case.

If the domain of the main page and iframe are the same then how to you intend to tell the iframes you want from the others?

bol
0
 
LVL 8

Accepted Solution

by:
netmunky earned 300 total points
ID: 17933483
<script type="text/javascript">
elements =   document.getElementsByTagName('IFRAME');
for( i = 0; i < elements.count; i++ )
{
  // do something here
}
</script>


if you want to just test which one it is, try:
<script type="text/javascript">
document.getElementsByTagName('IFRAME')[0].setAttribute('height', 600);
</script

then try it again with [1] instead of [0], then [2], then [3].
0
 
LVL 2

Author Comment

by:mostenscer
ID: 17934541
its not doing any thing
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 17934630
What is the domain of the main page and the iframe page?  Please look at my last comment which explains a security feature that would explain why it isn't working.  Let me know if you have any questions.

bol
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 17981181
Why the C grade (see grading guide at http://www.experts-exchange.com/help.jsp#hi73)?  Did you still have a question or need help with this?

bol
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime is disastrous for companies and can lead to major hits on a brand, reputation, an…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question