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 8468751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:01:29+00:00 2026-06-10T16:01:29+00:00

I have an IFrame in a DIV with its SRC attribute being dynamically set

  • 0

I have an IFrame in a DIV with its SRC attribute being dynamically set by a JS function. So, if src=”file.jsp”, then an onload function(inside the body in file.jsp) that contains adjustments to some styles inside the file.jsp was hovering IFrame all over the webpage once it was done with the function triggered by onload. i.e., iframe is spreading all over the webpage. Please let me know what needs to be done to preserve the IFrame position after the onload function.

The Code in my onload function is as shown

function load() {
    var url = window.location.href;
    if (url.indexOf('iip') > -1) {
        document.getElementById('peLibraryTreeDiv').style.width = "596px";
        parent.document.getElementById('privateEquityDiv').style.width =
                "96.9%";
        parent.document.getElementById('privateEquityDiv').style.top =
                "77px";
    }
}
  • 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-06-10T16:01:31+00:00Added an answer on June 10, 2026 at 4:01 pm

    this is a perfectly valid and working example

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
            <script>
            function changeIframe(newLocation){
                document.getElementById("myIframe").src=newLocation;
            }
            </script>
        </head>
        <body onload="changeIframe('http://www.example.com')">
            <div style="width:650px;float:auto;border:1px dotted #cccccc;">
                <iframe id="myIframe" src="http://www.ebay.co.uk/" width="100%" height=750px marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=1 scrolling=auto>
                  <p>Your browser does not support iframes.</p>
                </iframe>
            </div>
        </body>
    </html>
    

    please note that some websites cannot be added as src to an iframe like http://www.google.com (not sure why, I have made a question on SO here can't add google.com as src to an IFrame)

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

Sidebar

Related Questions

I have the following code: <div style= class=skiptranslate> <iframe frameborder=0 style=visibility:visible src=javascript:'' class=goog-te-banner-frame skiptranslate
So basically I have something like this <div class=iframe-holder> <span></span> <iframe src=iframe.html width=200 height=200
I have this iFrame in my parent window... <iFrame src=http://theirdomain.com id=Post_iFrame></iFrame> Then I have
Let's imagine that I have something like this: <html> ... <div> <iframe src=test.html hash=r4d5f7></iframe>
I have an iframe, well it's exactly an iframe, its a div with a
I have an XBAP that is in an IFRAME, wrap inside a DIV, which
I have an iframe inside a div tag with Overflow:Hidden and a Border-Radius of
I have an iframe in the jquery UI dialog , setting its src at
I have an iframe with a class name=blaclass. Inside it, I have one div
So I have a Div containing an iframe that I can Clone using JQuery.

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.