var dropped = false; var templateHtml; $(document).ready(function(){ function addlist(param) { $.ajax({ url: \'index.php\', data: \'drop=\'+encodeURIComponent(param), type: \'POST\', dataType: \'php\', success: function(msg) { if(parseInt(msg)!=0) { $(\'#pageContent\').html(msg); } } }); } setSortable(); $("#droppable").droppable({ accept:".drop", drop:function(event,ui){ dropped = true; addlist(ui.draggable.text()); } }); }); function setSortable(){ $("#sortable").sortable({ opacity: 0.6, cursor: \'move\', update: function() { var order = $(this).sortable("serialize") + \'&action=listing\'; $.post("index.php", order, function(theResponse){ $("#pageContent").html(theResponse); }); } }); $("#sortable li").addClass("drop").bind(\'mousedown\',function(){ templateHtml = $("#sortable").html(); }); }
- One
- Two
- Three
- Four
- Five
- Six
var dropped = false;
var templateHtml;
$(document).ready(function(){
function addlist(param)
{
$.ajax({
url: \'index.php\',
data: \'drop=\'+encodeURIComponent(param),
type: \'POST\',
dataType: \'php\',
success: function(msg)
{
if(parseInt(msg)!=0)
{
$(\'#pageContent\').html(msg);
}
}
});
}
setSortable();
$("#droppable").droppable({
accept:".drop",
drop:function(event,ui){
dropped = true;
addlist(ui.draggable.text());
}
});
});
function setSortable(){
$("#sortable").sortable({ opacity: 0.6, cursor: \'move\', update: function() {
var order = $(this).sortable("serialize") + \'&action=listing\';
$.post("index.php", order, function(theResponse){
$("#pageContent").html(theResponse);
});
}
});
$("#sortable li").addClass("drop").bind(\'mousedown\',function(){
templateHtml = $("#sortable").html();
});
}
addlist(ui.draggable.text());
function addlist(param)
{
$.ajax({
url: \'index.php\',
data: \'drop=\'+encodeURIComponent(param),
type: \'POST\',
dataType: \'php\',
success: function(msg)
{
if(parseInt(msg)!=0)
{
$(\'#pageContent\').html(msg);
}
}
});
}
А вот если в ней вместо пост запроса записать просто делать alert то после действия выдает alert и продолжает работать, значит проблема появляется после post запроса
- One
- Two
- Three
- Four
- Five
- Six
if(isset($_POST[\'action\']))
{
echo \'action\';
}
if(isset($_POST[\'drop\']))
{
echo \'drop\';
}
?>