记录:ajax submit refresh div
$(document).ready(function() {
	$("#formSearch").submit(function() {
		var options = {
			/* target:"#divResult", */
			success: function(html) {
				$("#txtSummary").replaceWith($('#txtSummary', $(html)));
			},
			url: "http://localhost/example/comp333assn1/php/group_list.php?q=all_contacts"
		}
		$(this).ajax(options);
		return false;
	});
});

这样不起作用1

<div id="items">
    <div id="item1">
        item 1
        <a href="#" class="move-up">Up</a> | <a href="#" class="move-down">Down</a>
    </div>
    <div id="item2">
        item 2
        <a href="#" class="move-up">Up</a> | <a href="#" class="move-down">Down</a>
    </div>
    <div id="item3">
        item 3
        <a href="#" class="move-up">Up</a> | <a href="#" class="move-down">Down</a>
    </div>
</div>
$('.move-up').click(function(e){
    var $div = $(this).closest('div');
    
    // Does the element have anywhere to move?
    if ($div.index() > 0){
        $div.fadeOut('slow',function(){
            $div.insertBefore($div.prev('div')).fadeIn('slow');
        });
    }
});

$('.move-down').click(function(e){
    var $div = $(this).closest('div');
    
    // Does the element have anywhere to move?
    if ($div.index() <= ($div.siblings('div').length - 1)){
        $div.fadeOut('slow',function(){
            $div.insertAfter($div.next('div')).fadeIn('slow');
        });
    }
});

还没有尝试不知能否起作用,但这样会有两个按钮但是非常不方便1,2


how to drag and drop only using button not by whole row? 1


下面的可以用来尝试简历条目循环插入1 下面实现了循环插入但是无法返回第一个1