我正在寻找一种将所选项目发送到 Jquery 的可选项到 php 页面的方法
<script>
$(function() {
$( "#selectable" ).selectable({
stop: function() {
var result = $( "#select-result" ).empty();
$( ".ui-selected", this ).each(function() {
var index = $( "#selectable li" ).index( this );
result.append( " #" + ( index + 1 ) );
});
}
});
});
$(function() {
$("#foo").submit(function(event){
$.post('batch.php?page=rinomina', {selectable: $('#select-result').html()});
});
});
</script>
<script>
$(function() {
$( ".direct" )
.button()
.click(function( event ) {
});
});
</script>
<form id="foo" action="" method="post">
<a href="javascript:{}" class="direct"onclick="document.getElementById('foo').submit(); return false;">submit</a>
但这是错误的,不明白我错在哪里!