Dynamic content doesn't work when loaded with ajax
- by Wurlitzer
I'm trying to load some dynamic content after the user has logged in, using $.ajax, like so:
$.ajax({
url: "functions.php",
type: "GET",
data: login_info,
datatype: 'html',
async: false,
success: function (response) {
$('#main').html(response);
}
});
The problem is, that some events don't work, when loaded this way. I fixed the buttons with the .live() method, but a sortable list for example, doesn't work. How can I somehow refresh the DOM, and let jquery know of these new added elements?
Thanks!