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

  • Home
  • SEARCH
  • 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 7492641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T16:30:00+00:00 2026-05-29T16:30:00+00:00

I have an external javascript that is called into a html page. The lines

  • 0

I have an external javascript that is called into a html page. The lines of javascript I am having problems with are as follows:

document.getElementById('lsb').innerHTML = '<iframe src="http://domain.com/feeds/" id="frame" frameBorder="0" style="border: none; width: 100%; min-width: 100%;" onLoad="calcHeight();" ></iframe>';

function calcHeight(){
    var the_height= document.getElementById('frame').contentWindow.document.body.scrollHeight;
    document.getElementById('frame').height=the_height;
}  

Now the interesting part is that this code works, when the fame is called the height is adjusted to that of its content so there is no scroll bar. However, if the src value of the iframe is not local to the javascript file and html then it doesn’t work, the height value is not set.

Does anyone know why this is, or have an alternative script?

Thanks in advance, and happy valentines day 🙂

  • 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-29T16:30:04+00:00Added an answer on May 29, 2026 at 4:30 pm

    This is a cross-domain issue, most browsers will not allow you to access/manipulate contents coming from different domain. This is a browser security restrictions.

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

Sidebar

Related Questions

I have a widget-like block of HTML+JavaScript that people can copy/paste into their HTML-page
I have external JavaScript file with simple document.write() call. Problem is that a tag
I have the following code in an external JavaScript file that is called within
I have an external JavaScript that contains: function random_imglink(){ var myimages=new Array() myimages[1]="http://sevir.sitegoz.com/jchs/Banner1.png" myimages[2]="http://sevir.sitegoz.com/jchs/banner2.png"
I have a Javascript object that requires 2 calls out to an external server
so I have an external javascript file, lets call it something.js and i document.write
I have a one page web application, which means alot of javascript. External scripts
I'm writing a webpage that relies on an external javascript file (that I have
I have an external javascript file that I want to, upon include, write some
I have an external javascript file that relies on the presence of another file.

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.