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

  • Home
  • SEARCH
  • 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 8292129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:22:02+00:00 2026-06-08T13:22:02+00:00

I have an iframe loaded dynamically with jQuery like this jQuery(‘<iframe id=myFrame src=iframesrc.php></iframe>’).load(function(){ //

  • 0

I have an iframe loaded dynamically with jQuery like this

jQuery('<iframe id="myFrame" src="iframesrc.php"></iframe>').load(function(){
    // do stuff when loaded
}).prependTo("#myDiv");

And I want to catch the reload event every time the inner frame is reloaded. I tried this:

jQuery('body').on('load', '#myDiv', function() {
    alert('iframe loaded');
});

But I’m not getting any response, both on the initial load and when following links inside the iframe. What am I doing wrong?

  • 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-08T13:22:04+00:00Added an answer on June 8, 2026 at 1:22 pm

    You are looking for the load action of a div in your example above, not the iframe. Try:

    $("#myFrame").on("load", function () {
        alert("Hi there, hello");
    })
    

    Additionally, if you are not using other libraries, use $() to access jQuery as opposed to jQuery()

    Also note that any functions that you want to run on your page must be bound to jQuery’s document ready event like so:

    $(function () {
        // your code goes here
        $("#myFrame").attr("src", "http://google.com"); // <- this works
    })
    
    $("#myFrame").attr("src", "http://google.com"); // <- this does not work
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a program which will dynamically set an iframe src to load pages.
I have a page that contains a dynamically loaded <iframe> . This iframe contains
I have an iframe that looks like this: <iframe id=iframe2 ...> #document <html>...</html> </iframe>
I have this iFrame in my parent window... <iFrame src=http://theirdomain.com id=Post_iFrame></iFrame> Then I have
I'm building a site and I would like to have external content dynamically loaded
I have used a tutorial http://www.devcurry.com/2010/06/load-page-dynamically-inside-jquery-ui.html to dynammically load an aspx page into a
so I have a PHP iframe (ajax) file uploader. I would like to display
I have parent page index.php and inside it i have iframe like below <div
I have an iframe loaded within a page. This code works fine in firefox
I have an iframe loaded with some content. I would like to move it

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.