Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have Refersh accordion Div Every Second...Data is Get But accordion is Not Working in javascript.......Please Help me

What I have tried:

Html Code
HTML
<div id="accordion">



               </div>




Javascript Code
JavaScript
<script type="text/javascript">
        $(document).ready(function () {
          
            
                getIBtrade();
            
            
        });

 function getIBtrade() {
            var id = document.getElementById("hdibid").value;
            //alert('Hi');
            $.ajax({
                type: "POST",
                url: "Home.aspx/GetData",
                data: "{IBid:" + parseInt(id) + "}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (response) {
                 
                  var list = document.getElementById("accordion");
                    list.innerHTML = response.d;
                    $("#accordion").accordion();
                    
                }
            });


        }

       setInterval(function () {

            
            getTotal();
       
            
       
           

        }, 700);

    </script>
Posted
Updated 5-Aug-16 21:00pm
v3
Comments
Krunal Rohit 6-Aug-16 1:23am    
Are you using Bootstrap accordion ?

KR
kaushik ahir 6-Aug-16 2:59am    
no


Karthik_Mahalingam 6-Aug-16 1:24am    
what is the data coming from response.d;
and getTotal()
kaushik ahir 6-Aug-16 2:59am    
Dynamic Design Bind using web Method
Karthik_Mahalingam 6-Aug-16 3:09am    
so for every 700 milliseconds you are refreshing the content inside the accordion?

1 solution

Problem Solve...

$("#accordion").accordion("destroy");
               $("#accordion").accordion();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900