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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:31:12+00:00 2026-06-11T18:31:12+00:00

I am emulating a modal window functionality on my HTML5 page by creating a

  • 0

I am emulating a modal window functionality on my HTML5 page by creating a div with position: fixed, centered in the browser window etc. In some cases my modal window just shows a message with one or more buttons, such as OK Cancel, but in other cases I’m showing more complicated forms, e.g. an instant messaging dialog.

The question is for the more complicated cases. So which is better, (1) to have an <iframe> in my “modal” window or (2) a <div> plus some Ajax code that retrieves the contents of my form and injects it into the div’s innerHTML?

What are some caveats in either case? When you choose one over the other, what is your reasoning?

Browser requirements: IE9+ and the rest of the sane browsers.

  • 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-11T18:31:13+00:00Added an answer on June 11, 2026 at 6:31 pm

    You should only use an iframe if you actually need an iframe. Reasons to use an iframe are:

    1. The simplest way to load content from another domain.
    2. To isolate the security context for content from a separate domain.
    3. To embed a completely independent web page (independent scripts, independent style sheets, etc…) in your web page.
    4. You don’t want to write ajax code to load content dynamically and want to just use the built-in .src capability of an iframe.

    If you don’t need any of these capabilities of an iframe, then it’s generally easier to use use a div (which will auto-size to its content – whereas an iframe will not) and put the desired content in that div.

    Either can be made to work.

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

Sidebar

Related Questions

we are tasked with basically emulating a browser to fetch webpages, looking to automate
I am creating a UI with dojo that is emulting some aspects of an
How would I go about making the button open in a new window, emulating
So I am creating C++ HTTP emulating via TCP server. I will have simple
I am emulating the functionality of an old app in VB.Net. I have a
I'm emulating the DESCRIBE tablename available in Sqlplus to make similiar functionality available via
I was going through some notes and I realized something is amiss. When emulating
Emulating multithreading by loading a DLL multiple times (it's designed for this). Since LoadLibrary()
I'm emulating MS-DOS 6.22 with PocketDOS , but I want to develop for Palm
I am trying to stress test a client/server system by emulating multiple clients connecting

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.