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

The Archive Base Latest Questions

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

I have two websites A.com and B.com. I have to embedd B.com in an

  • 0

I have two websites A.com and B.com. I have to embedd B.com in an iframe in A.com. I cannot make any changes at B.com

B.com only works with post requests with some post data . I have this working as following

<!--This is the div inside which I will embedd the iframe-->
<div id="frameDiv"></div>

<script type="text/javascript">

    //Create iframe
    var $ifr = $('<iframe name="myFrame" id="myFrame"></iframe>');

    //create form
    var $form = $('<form action="B.com" method="post" target="myFrame"></form>');

    //Append hidden field to form to pass postData
    $form.append($('<input type="hidden" name="dataName"><input>').val('data'));

    //Append form to the iframe and then append iframe to the div    
    $('#frameDiv').append($ifr.append($form));

    $form.submit();
</script>

Now, B.com loads perfectly within the iframe with response to the post request. But B.com is slow. I want to show a spinner inside the #frameDiv till the iframe loads. How can I do this?

This is what I tried:

$('#frameDiv').append($spinnerImage)

//Does not work, fires immediately
$ifr.load(function(){
    //Hide the spinner image
});

//Does not work, fires immediately
$ifr.ready(function(){
    //Hide the spinner image
});

If B.Com was a simple get and was set as the src attribute of the iframe, jQuery load method does the trick. But in this case it does not.

Any help is appreciated 🙂

  • 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:39:45+00:00Added an answer on June 6, 2026 at 7:39 am

    You can try binding a new load event listener within the initial load event handler of the iframe. The following works on same domain iFrame:

    $ifr.load(function(){
        /* bind new load event listener for next load*/
        $(this).load(function(){
             /* hide spinner*/
        })
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I only have two websites pointed to my server IP, Asite.com and Bsite.com .
I have two websites: http://example.com http://example.com/sub I have a page, let's say: http://example.com/sub/page1 Is
I have two similar wordpress websites. http://site.com/ and http://site.com/en/ When I try to load
I have two websites that post news information. I just got a request to
I have two websites that have an almost identical database schema. the only difference
I have two websites http://www.buywwetickets.com/ http://www.ufcticketbooth.com/ The problem is that sometimes before the websites
This is the setup: I have two websites on two different domains: www.website1.com www.someotherwebsite.com
I have two websites https://www.foo.com and https://www.bar.com . bar.com is the actual application, but
I have two IIS websites, namely accounts.example.com that was created in Visual Studio 2010
I have two websites OLD.com (classic ASP) and NEW.com (ASP.NET) - each site has

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.