Solved

Changing Iframe Heigh (URGENT)

Posted on 2006-11-13
10
232 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
  • 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
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…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

831 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