jquery submit form without refresh
Hi, I need help !
In my code i send some data to the server and get html data back.
- <script type="text/javascript">
$(document).ready(function()
{
- $(document).on('submit', '#qu-form', function()
{
var data = $(this).serialize() + '&cmgroup=<? echo $_SESSION['category'] ?>' + '&type=Question';
$.ajax({
type : 'POST',
url : 'db_functions/submit',
data : data,
success : function(data)
{
$("#qu-form").fadeOut(500).hide(function()
{
$(".quresult").fadeIn(500).show(function()
{
$(".quresult").html(data);
});
});
}
});
return false;
}
});
- });
- </script>
This is working fine but
the accordion function does not work anymore.
- <script src="accordion.js" type="text/javascript"></script>
</head>
<body>
<div id='cssmenu'>
<ul>
<li><a href='#'><span>Question 1</span></a>
<ul>
<li><a href='#'>1</a></li>
<li><a href='#'>2</a></li>
<li><a href='#'>3</a></li>
</ul>
</li>
<li><a href='#'><span>Question 1</span></a>
<ul>
<li><a href='#'>1</a></li>
<li><a href='#'>2</a></li>
</ul>
</li>
</ul>
</div>
When i click on the <li> it does not work and do nothing
After a refresh of the website it works!
I really do not know what to do yet