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

The Archive Base Latest Questions

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

Below are the codes for 2 accordions (jquery ui). The first is hardcoded with

  • 0

Below are the codes for 2 accordions (jquery ui). The first is hardcoded with html, and the second one is delivered to the page, on Document ready, via jquery.

HTML: [This accordion works]:

<div class="accordion">
    <h3><a href="">one</a></h3>
    <div>aaaaaaaaaaaaaaaaaaaaaaaa</div>

    <h3><a href="">two</a></h3>
    <div>bbbbbbbbbbbbbbbbbbbbbbbb</div>
</div>

PHP: [This accordion does not work]

echo'
<div class="accordion">

    <h3><a href="">One</a></h3>
    <div>111111aaaaa</div>

    <h3><a href="">Two</a></h3>
    <div>222222aaaaa</div>

    <h3><a href="">Three</a></h3>
    <div>333333</div>  
</div>
';

How do I make the dynamically delivered accordion also work?

EDITED:

$(document).ready(function(){

    $('#drag').draggable();
    $('.accordion').accordion();

    $.post('scripts/test.php', {  },
        function(output){
            $("div#test_php").html( output );
        }
    );

});

On Document Ready == set up the accordion functionality, and then request the second accordion from php script, embedding it into the DOM.
All the php script does is echo the code for a second accordion.

  • 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-26T21:42:29+00:00Added an answer on May 26, 2026 at 9:42 pm

    You need to reinitialize the accordian again if you’re injecting it dynamically into the DOM.

    $.post('scripts/test.php', {  },
            function(output){
                $("div#test_php").html( output );
                $('.accordion').accordion();
            }
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Below is just a mockup of 2 codes in php/mysql. The first one returns
This below codes give me error below: How to generate this codes help me
Look please below this codes throw me : FormatException was unhandled by user code
I hope to list all files in document directory using codes below for(NSString *path
For some weird reason, the codes below are first working, then website is redirecting
I've set up a number of accordions on a page using the jquery accordion
I have a JQuery Accordion as below; <div id=accordion> <h3 class=ui-accordion-header><a id=link1 href=#>First Header</a></h3>
I have a problem with a jquery function. My HTML looks like this, I
I have a page, which uses jQuery Autocomplete on the second two textboxes (investigator
these below codes give whole data of my Rehber datas. But if i want

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.