Solved

Changing Iframe Heigh (URGENT)

Posted on 2006-11-13
10
234 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
Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

 
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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

717 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