Ways to display an Iframe within a div元素

I have multiple frames loaded on the page that I want to display within a specific div element.

Currently, I have a pop-up with a div where I include the frames inside. However, there are times when I need to access frames outside of this div container.

<div id="Main" ></div>
            <iframe src="frmtest1.aspx" style="display:none"></iframe>
            <iframe src="frmtest2.aspx" style="display:none"></iframe>
                <input type="button" id="LoadTest1" />
                <input type="button" id="LoadTest2" />

Answer №1

In situations where your frames are positioned outside of the 'div' container, it is necessary to establish specific width and height values for the div element. By utilizing the 'position:absolute' style along with setting the left and top (px) properties accordingly, you can visually place the frame inside the div.

Answer №2

It seems like you're asking about using frames outside of a div tag?

If that's the case, simply add the source again where you want them to appear.

<iframe src="frmtest1.aspx" style="display:none"></iframe>
<iframe src="frmtest2.aspx" style="display:none"></iframe>

Just copy and paste these into another container.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Just finished the "Modern React with Redux" Udemy course and encountering some peculiar problems. Any assistance in solving them would be greatly appreciated!

While following the lectures, I made the decision to completely remove the "src" folder. To my surprise, even after refreshing the browser on the "localhost:8080" page, the content "Hello There!!!" from the index.js file remained visible. This was quite st ...

Is there a way to implement tooltips on an element that has text-ellipsis enabled?

I am facing an issue with displaying an account number that exceeds 100 characters. I need to restrict the display with overflow hidden while still being able to show the full account number using a tooltip. Below is the code snippet: <span class="tex ...

How to get the total number of rows/records in a JSON store using ExtJS?

My dilemma involves a JSON store that provides data in JSON format. I am currently attempting to determine the number of rows or records in the JSON string. However, when utilizing the store.getCount() function, it consistently returns 0. Strangely, the ...

Is the performance impacted by using try / catch instead of the `.catch` observable operator when handling XHR requests?

Recently, I encountered an interesting scenario. While evaluating a new project and reviewing the codebase, I noticed that all HTTP requests within the service files were enclosed in a JavaScript try / catch block instead of utilizing the .catch observable ...

How can I locate the next sibling element in JavaScript or jQuery?

I am currently working on a shopping cart feature with a view of the cart list count displayed. However, I have come across this particular code snippet in my document: <div class="input-group input-number-group"> <div class="in ...

Refresh a specific div element within an HTML file when the AJAX call is successful

After uploading the image, I want it to be displayed right away. To achieve this, I am looking to refresh the div with id="imagecontainer" within the success function of my ajax call. However, I would prefer not to rely on ("$id").load("href") as it does ...

Maximizing code reusability in Angular 6 by utilizing the same form structure with distinct [(

I am seeking advice on the best approach to create a form similar to this. Here is my current form: <div class="phone"> <label>Phones</label> <div class="tel" *ngFor="let t of phones"> <div class="row"> ...

Looking to update the key name in a script that produces a list sorted in ascending order

I have been working on code that iterates through a flat json document and organizes the items into a hierarchical structure based on their level and position. Everything is functioning correctly, but I now need to change the name of the child elements to ...

Can WebGL be configured to render offscreen without its canvas being directly connected to the DOM?

Searching for an answer to what I believed would be a simple question has proven to be quite challenging. My goal is to utilize WebGL for image processing and generation tasks, with the intention of working offscreen. Specifically, I aim for WebGL to rende ...

Open a new tab when making an asynchronous API call

I'm having trouble with calling a function and opening a new tab in my VueJS application. Here is an example of what I want to do: const someFunction = async () => { const value = await api.someCallToApi(); window.open('https://example.c ...

Is it possible to dynamically alter the DataSourceId of a Gridview?

I am currently working on an asp.net page that includes the following code: <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="DateToVisit" DataSourceID="AccessYouthSchedule" AutoGenerateEditButton="True"> ...

Attempting to insert anchor links pointing from external pages to my mvc hyperlink

Here is the link on our company's ASP.NET-MVC site: @Html.ActionLink("OPIE Administrative & Compliance Track", "Index", "OPIECon") Since I am new to MVC, I have been struggling to find answers on my own. Currently, the link directs me to the OPIECon ...

A stylish flyout menu with a sleek li background in jquery

Experimenting with http://tympanus.net/Tutorials/CufonizedFlyOutMenu/, I decided to remove the fly-in descriptions and am now attempting to load the extra li with a style that will "highlight" the li.current-menu-item element. An object is set up as follo ...

The Challenge of Integrating ThreeJS with AngularJS Scope Object: Discrepancy with requestAnimationFrame Callback Handling

Greetings, Currently, I am engaged in a series of experiments to refresh my JavaScript knowledge, explore the capabilities and purposes of AngularJS, and delve into ThreeJS. Normally, my programming involves OpenGL/MFC in C++, but I have dabbled in php/js ...

With Jquery, my goal is to position a div outside of another div element

I need to place a div tag in a specific way, like this: <div class="abc"> <div class="mySlides fade"> <img src="img_nature_wide.jpg" style="width:100%"> </div> <div> Using jQuer ...

What is the method to disable the "attr" binding element?

Is it possible to set a value that is not true in an attribute like this? <div data-bind="visible:isActive, attr: { 'aria-hidden': !isActive() })"> { Content } </div> This method does not seem to work for me. Appreciate ...

Error: The object reference is missing in the List and has not been assigned to an instance

Receive the following error message "Object reference not set to an instance of an object Error" when attempting to add an item to a list. This error occurs specifically in the line where it adds Name to addtoNote. It is confirmed that Name is not null. ...

initiate a new action when the type value is modified

For example, I start with a type like this: type wallPaper = 'red' After applying this type to 100 variables, I decide I want a different color: type wallpaper = 'blue' Is there an extension that can automatically replace the value ...

The Ajax request was a success, but unfortunately the value in $_POST['value'] is empty

PROBLEM SOLVED The problem appeared to be browser-related. Switched to a different system and the issue was resolved. I am currently working on coding a live search feature that displays user details from a database using ajax and php. The input from t ...

What could be causing the request body in ExpressJs to be blank?

Using ExpressJs, I have created a simple app that can handle post requests and form submissions. Below is the code snippet from my index.js file: require ('./models/db'); const express = require('express') const app = express() const bo ...