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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:26:28+00:00 2026-05-26T20:26:28+00:00

In my website i made a mainpage which has 3 divs: header, footer and

  • 0

In my website i made a mainpage which has 3 divs: header, footer and main. Header div has some buttons which change main div. Means that page is loaded only once then i just change main div when some button is clicked. I simply put a html page in main div when some button is clicked.

i have put alert in every page’s $(document).ready function. Whenever main div is changed, these alerts should come because main div is a html page. But these alerts are not coming. Why is that so. I want to load some data every time when main div is changed. How can i do that? Thanks in advance.

main page:

 <html>
   <head>
     <script type="text/javascript" src="jquery-1.7.js"></script>    
 <script language="javascript" type="text/javascript">
         $(document).ready(function() {
             $("#btn1").click(function(){
                 $("#main").load("page1.html");
             });

             $("#btn2").click(function(){
                 $("#main").load("page2.html");
             });
         });
     </script>
</head>

    <body>
    <div id="header"> --- </div>
            <div id="maincontent"><div id="main"> --- </div></div>
            <div id="footer"> --- </div>
    </body> 
 </html>

page1:

  <html>
   <head>
     <script type="text/javascript" src="jquery-1.7.js"></script>    
 <script language="javascript" type="text/javascript">
         $(document).ready(function() {
             // trying to load data. but its not working
         });
     </script>
</head>

    <body>
    <div id="page1-div"> --- </div>

    </body> 
 </html>
  • 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-26T20:26:28+00:00Added an answer on May 26, 2026 at 8:26 pm

    You are just making changes in DOM, not loading new document which would trigger $(document).ready();.

    Based in questions tags, i assume that you are loading content using AJAX. In that case just use jQuery’s callbacks for $.ajax* functions to do any kind of action when content is loaded.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made a website that has 2 WordPress installs one for English language
On a website I made, one person sent me a screenshot which shows that
I made a website that has a hierarchical structure and has search engine friendly
A suggestion/inquiry was made that a div on the website be made into a
why isn't the cookies storing? the local website I made has a setcookie(test,time()); in
I made a website, and I called it rar.com, which happens to be a
I've made a website, to test the html5 audio. Unfortunately some browser doesn't support
I have a website that I made and I am planning to redo it.
So I've finally made a website that looks great in every major modern browser.
I have a website made with CakePHP 1.3.7. This website has it's own login

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.