【发布时间】:2011-02-16 15:01:45
【问题描述】:
在对图像进行排序后,我想将包含图像路径和标题的数组发送到 PHP 脚本。 我可以对列表进行“序列化”或“toArray”,但是如何从 img 标签中获取属性?
<ul class="gallery">
<li id="li-1">
<img src="tn/001.jpg" alt="first caption" />
</li>
<li mycaption="some caption" id="li-2">
<img src="tn/002.jpg" alt="second caption with éèçà international chars" />
</li>
</ul>
$(".gallery").sortable({
update : function() {
serial = $('.gallery').sortable('serialize');
alert(serial);
/* $.ajax({
url: "sort.php",
type: "post",
data: serial,
error: function() {alert("theres an error with AJAX");}
}); */
}
});
【问题讨论】:
标签: jquery-ui jquery-ui-sortable serialization children toarray