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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:46:57+00:00 2026-06-01T04:46:57+00:00

I have butons which are created dynamically, each button has an id set in

  • 0

I have butons which are created dynamically, each button has an id set in ‘rel’ attribute. When I click the first button, it display the correct information, when I click the second button it’s already ok, but if i re-click on the first button, it loads the information related to the second button.

if you want too see live : jsfiddle

$('#target').hide()

$('.e-link').bind('click',function(){
    var link = $(this).attr('rel');
    $('#target').hide('fast',loadContent);
    $('#'+link).show('fast',loadContent);

    function loadContent() {
        $('#target').load(showNewContent())
    }

    function showNewContent() {
        $('#target').show('normal',hideLoader());
    }

    function hideLoader() {
        $('#load').fadeOut('normal');
    }

    return false;

HTML CODE

   <div id="port">
   <!-- Begin Item  -->
   <div class="e-target" id="target">   
        <div class="e-block" id="block_211">
  <div class="inner">
             t: Xt
             D: XD
             P: XP
</div>
    <div class="e-block" id="block_491">
  <div class="inner">
             t: Yt
             D: YD
             P: YP
  </div> 
 </div>
     <!-- End Item  -->

 <!-- Begin button -->
  <ul class="works" id="case_items">
  <li class="post-211 menu menu"> 
 <a href="#" class="e-link" rel="block_211">  X
    <img width="150" height="150" src="http://xxxx.jpg" class="thumbnail" alt="X"     title="X" />            
  </a> 
  </li>
  <li class="post-491 type-menu "> 
          <a href="#" class="e-link" rel="block_491"> Y 
            <img width="80" height="80" src="http://YYY.png" class="thumbnail" alt="Y" title="Y" /> 
  </a> 
  </li>
  </ul>
   <!-- End button -->

   <div class="clear"></div>
      </div>

Any advice?

  • 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-01T04:46:59+00:00Added an answer on June 1, 2026 at 4:46 am

    I don’t know if this is the extent of your problem, but both of these are wrong:

    function loadContent() {
        $('#target').load(showNewContent())
    }
    
    function showNewContent() {
        $('#target').show('normal',hideLoader());
    }
    

    They should be this:

    function loadContent() {
        $('#target').load(showNewContent)
    }
    
    function showNewContent() {
        $('#target').show('normal',hideLoader);
    }
    

    You want to pass a reference to your functions, not actually execute them and pass the return value.

    Without seeing your HTML, it’s a little hard to diagnose further.

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

Sidebar

Related Questions

I have created 4 buttons via Interface Builder. I have an array which has
I have few buttons of which each button is assigned a class with a
I have created 10 buttons programmatically and set the titles in the button. Now
I have created a spark ButtonBar which is dynamically populated with XML and skinned
In Application i have two buttons in which one button is used as a
I am trying to build a layout dynamically which display some text and image
I have a dynamically created toolbar on a plain Win32 dialog. My buttons are
I have created two link buttons dynamically: for (int i = 0; i <
I've been having some trouble with a set of dynamically created buttons in PyQT.
I have some radio buttons that are created dynamically with javascript. I need to

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.