Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6822593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:40:56+00:00 2026-05-26T21:40:56+00:00

I have a page with an Iframe. I am using the following code to

  • 0

I have a page with an Iframe. I am using the following code to get the size of Iframe:

<script language="javascript">
function sn()
{

alert('height is now '+document.getElementById("Iframemain").height)
alert('height is now '+document.getElementById("Iframemain").width)
}
</script>
<input type="button" onClick="sn()" value="Show height/width">

I have also another page with an Iframe but i do not know the id of the Iframe. I want to know the size the of the Iframe using javascript. How can i do it?

thanx in advance .

Thanx Rory McCrossan
i have also tried that following code but getting udefined in alert msg.

<script language="javascript"> function sn() 
{

var frame = window.frames[0];
 alert(frame.width) 
 alert(frame.height)

 } 
</script>
 <input type="button" onClick="sn()" value="Show height/width"> 
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T21:40:56+00:00Added an answer on May 26, 2026 at 9:40 pm

    If you don’t know the ID of the frame, and it is the only frame/iframe on the page you can use the following code:

    var frame = window.frames[0];
    alert('height is now ' + frame.height)
    alert('width is now ' + frame.width)
    

    If it is not the only frame, you’ll need to change the window.frames[index] as required.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an iframe in a page, with the following auto-height script. function autoHeight(e)
Possible Duplicate: I have a problem with IFrame . Now i am using iframe.attribute(src)=..Pages/page.aspx....In
say an HTML page (Page.htm) contains the following... <script type=text/javascript> var vara = 'varA';
I have an iframe loaded within a page. This code works fine in firefox
I have chromeless application with some privileged JavaScript code interacting with the system.Now I
I have an iframe Facebook application (using Facebook's new JavaScript API) that needs to
I have loaded a page in Fancybox using a iframe . But when I
I have a page with an iframe. In the iframe is a form targeting
I have a page that has an iframe From one of the pages within
I have a web page with an iframe in it (I don't like it,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.