Solved

Changing Iframe Heigh (URGENT)

Posted on 2006-11-13
10
229 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
 
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
This video teaches users how to migrate an existing Wordpress website to a new domain.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

708 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now