?
Solved

Changing Iframe Heigh (URGENT)

Posted on 2006-11-13
10
Medium Priority
?
236 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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 400 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 600 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
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 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…
Suggested Courses

770 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