Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在加载这样的li列表
li
$('#knowledgeList').load('file.php#knowledgeList');
但是我还需要使列表可排序:
$('#knowledgeList').sortable();
如果我不通过 Ajax 加载项目,但如果它们通过 Ajax 加载,则它们不再可排序。
为了将任何 JavaScript/jQuery 应用到通过 AJAX 调用的组件,您需要在回调函数中操作的对象。
$('#knowledgeList').load('file.php #knowledgeList',function(){ $('#knowageList').sortable(); });