Reputation: 4995
I'm loading a li
list like this
$('#knowledgeList').load('file.php#knowledgeList');
However I also need to make the list sortable:
$('#knowledgeList').sortable();
That works if I don't Ajax load the items in but if they are loading in via Ajax they are no longer sortable.
Upvotes: 1
Views: 540
Reputation: 16359
In order to apply any JavaScript/jQuery to the component called in via AJAX, you need the object you want to manipulate in a callback function.
$('#knowledgeList').load('file.php #knowledgeList',function(){
$('#knowageList').sortable();
});
Upvotes: 2