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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:11:26+00:00 2026-06-11T11:11:26+00:00

this is my main page html: <script type=text/javascript src=js/jquery.min.js></script> <div><a href=# class=MyClick>Parent Click</a></div> <div

  • 0

this is my main page html:

<script type="text/javascript" src="js/jquery.min.js"></script>
<div><a href="#" class="MyClick">Parent Click</a></div>
<div class="content"></div>
<script>
  $(document).ready(function(){ 
    $('.MyClick').click(function(){
       $('.content').load('page2.html');
    }); 
  })
</script>

and this is page2.html

<a href="#" class="showoff">Child Click</a>
<script type="text/javascript">
 $(document).ready(function(){      
    $('.showoff').live('click',function(){
        console.log('I Clicked');
    });     
 });
</script>

when link parent click clicked, load page2.html into div.content and when child click cliked print in console firebug once..

but my problem is when I click again parent click and click again child click,
in console print twice however I click once, it’s like page2.html before not yet remove from DOM and child click in page2.html before fired together with a new one..

I want to how many time I load page2.html it’s not print multiple line when I just click once Child click

  • 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-11T11:11:27+00:00Added an answer on June 11, 2026 at 11:11 am

    Every time you load page2.html you register a delegate click handler for .showoff since you use .live()(which is deprecated by the way, use .on() or .delegate() for version < 1.7), that’s why you get multiple prints per clicks.

    Are you using live for a specific purpose? Cause it seems unnecessary to me, just use a handler on the element itself.

    <a href="#" class="showoff">Child Click</a>
    <script type="text/javascript">
     $(document).ready(function(){      
        $('.showoff').on('click',function(){
            console.log('I Clicked');
        });     
     });
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The main structure of the page is like this: <html> <body> <div id=Menu> <h1>Menu</h1>
On my main page I have this jquery code which does an ajax call
On a portal's main page, I'm using a jQuery container plug-in, and by this
In the below shown html i have this main div as cxfeeditem feeditem and
I am running the following jQuery .get() call from an HTML page: <div id=fw_results>Results</div>
I have 2 master pages that are nested.this is main master page code for
I'm trying to do blog application and I want main page to have this
I have this web application using Spring Web Flow framework. In my main page
I have simplified my page and here what I have: <html> <head> <meta http-equiv=content-type
This is my exibitview.html page <!DOCTYPE html> <html lang=en manifest=health.cache> <head> <meta http-equiv=cache-control content=no-cache

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.