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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:22:29+00:00 2026-06-13T01:22:29+00:00

I have an app that has a 1 page with a DIV that changes

  • 0

I have an app that has a 1 page with a DIV that changes its content when the user clicks part of my navigation bar (which is contained within the same page).

So here is my div that I have in my one page app

<div id="content">
</div>

Now I populate this DIV with other html files using the jQuery .load() method (the HTML files that are fed into the .load method I have stripped of and tags, etc, etc…)

Here’s my JavaScript

$("#content").load("views/"+ pageName + ".html", function(){
// do stuff… like load JavaScript files, etc...
}).fadeIn("fast");  

This is working fine however the content which is brought to the page using the .load() I wish to attach a function to once it has loaded to the DOM.

So say I .load() the following contents from a HTML page using the JavaScript above

<p id="newText"> Blah blah blah blah blah blah blah blah blah blah blah</p>

I wish to raise an event once this is loaded, however I’m unsure what I should bind it to, like .live(), .on() or .ready()… I was thinking of something like this…

$('#newText').load(function() { 
   alert("Handler for .load() called for newText. This is in the DOM and loaded!");
});

Does anyone know how I should go about this?

* UPDATE *

Okay perhaps I need to explain… I am inherited this app from another developer and I think it was built with a bad architecture / model. Anyway, the pages or views that are loaded have a lot of hidden tabs / toggled content (hence me not liking the architecture) so despite the view / HTML being loaded some of its content may not be available in the DOM when first loaded. That is why I am wishing to detect when a something is loaded into the DOM on top of using the jQuery Ajax .load()

  • 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-13T01:22:31+00:00Added an answer on June 13, 2026 at 1:22 am

    Use either the native .load() callback:

    $('#result').load('ajax/test.html', function() {
      alert('Load was performed.');
    });
    

    Or the .ajaxStop() which registers a handler to be called when all Ajax requests have completed.

    $('#result').ajaxStop(function() {
        alert('Triggered ajaxStop handler.');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a client that has an app built with django. On every page
I have an app that has an IFrame with a page flash overly allowing
I have a jquery mobile app that has a page. This page has three
Have an app that has listings - think classified ads - and each listing
I have an app that has different names for different languages. How do I
I have an app that has a centre view with two views off to
I have an app that has a tabbar at the bottom. When I select
I have an app that has a TableView, NavigationView and TabBar running together. There
I have an app that has a list of items. My customer prefers to
i have an app that has a few checkboxes in the settings and then

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.