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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:16:47+00:00 2026-06-06T07:16:47+00:00

I have an iframe pointing to arbitrary foreign domain http://A . I want to

  • 0

I have an iframe pointing to arbitrary foreign domain http://A. I want to send it to another foreign domain http://B on a user event.

Say http://B is slow to load. If I just set iframe.src = "http://B", then the iframe will keep the contents from A until B is downloaded fully and can render. This is confusing for the user because they asked for B, but all they see is A.

I want to load a page from my domain, say ../html/loading.html, in between A and B. Assume that this page load will always be fast.

I have observed that setting iframe.src is asynchronous. Consider the following code:

iframe.src = '../html/loading.html';
iframe.src = 'http://B';

This skips opening ../html/loading.html and goes right to http://B. (Regardless of how fast loading.html might be, or how slow B might be). I also tried doing this:

iframe.src = '../html/loading.html';
iframe.contentWindow.location.reload();
iframe.src = 'http://B';

However, this throws cross-domain errors, saying I can’t access stuff in the contentWindow of http://A (because loading.html hasn’t loaded, we’re still on http://A and I can’t force a reload).

Is there a way to force an iframe to do a synchronous load of a URL? I’m writing a Chrome Extension, so if it has to be specific to crx that’s okay too.

  • 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-06T07:16:49+00:00Added an answer on June 6, 2026 at 7:16 am

    Try this:

    Initially iframe should load loading.html using

        iframe.src = '../html/loading.html';
    

    In client side onload event of loading.html, the source should be changed to other domain B using

        iframe.src = 'http://B';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a webpage with an <iframe> pointing to another website. I don't want
I have an iFrame and I want the user to be able to grab
I have an IFrame on my page pointing to a page containing list of
i know i can have iframe in a html page, say parent.htm, and i
I have a iframe that i want to open pdf's into from a list
I have an IFrame with a Table enclosed within it. I want to display
I have an iframe in a tab with a hidden element, and I want
I have a very simple iFrame with src attribute pointing directly to an xml
we have a site with Iframes pointing to dynamic Urls (by user input). In
I have iframe based facebook app, I just want to do is that whenever

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.