php - Using JQuery UI's sortable('serialize') after loading data in via .load();
Get the solution ↓↓↓Solution:
If everything you posted above is being brought into another page via.load()
, then I see (at least) two problems:
- You're loading jQuery and jQuery UI twice: once in the outer page, and once in the inner page loaded via ajax. There's no need.
- You're expecting
$(function(){})
to fire after being loaded into the "inner" page within thediv
.$(function(){})
is a synonym for$(document).ready( function(){} )
, and in fact theready
event has already fired (when the outer page DOM became ready). It won't do anything here.
You should try triggering the.sortable()
stuff inside the callback of the.load()
you're using to bring the inner document into thediv
:
/* on page1.php */
$('#yourdiv').load( 'page2.php', function(){
$('#thelist').sortable( /* arguments */ );
});
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: malformed utf-8 characters, possibly incorrectly encoded
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.