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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:30:53+00:00 2026-05-19T01:30:53+00:00

I am currently creating a page where upon clicking a link an iframe is

  • 0

I am currently creating a page where upon clicking a link an iframe is inserted into a div and it’s contents loaded. I do this using the following jQuery call:

$('#mydiv').html('<iframe src="sourcelink.html" frameborder="0" width="760" height="2400" scrolling="no"></iframe>');

Sometimes the source content loads very slowly and, as a result, it looks like nothing is happening. I would like to have a simple loading animation while the content is loading while the iframe’s content loads. When the iframe finishes loading it’s content should pop in and the loading animation should go away.

I’ve been considering a couple ways I could do this (e.g. having a separate loader div to simply swap the two in and out) but I’m not sure of what the ‘best’ approach to solving this problem is. Perhaps I shouldn’t be using .html()? I’m open to suggestion if there is a more correct solution.

  • 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-19T01:30:54+00:00Added an answer on May 19, 2026 at 1:30 am

    Is there any reason you can’t listen to the onload event of the iframe itself? It should fire after the child content has loaded.

    Something like this:

    showLoader();
    $('#mydiv').html('<iframe src="sourcelink.html" frameborder="0" width="760" height="2400" scrolling="no"></iframe>');
    $('#mydiv iframe').load(function() { hideLoader(); }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently creating an explicit reference to this in the outer class so that
I am currently creating an e-commerce site using C# ASP.NET MVC and have just
I'm currently creating a very small form on my homepage using HTML and JavaScript.
I'm currently creating integer constants in the following manner. public class Constants { public
I am currently creating my first project using Google App Engine in Eclipse. For
Problem: I am currently creating a webpage layout using divs and css rather than
A little background first as to why I need this. I am currently creating
I am creating a entry page for kiosk device using WPF. There a 3
I'm currently creating an application for a customer that will allow them to automatically
I'm currently creating a WinForm in VB.NET bound to an access database. Basically what

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.