刘刚博客

Jquery each ajax 赋值

<script type="text/javascript">
$(document).ready(function () {
$("#mylist li span").each(function () {
var myid = $(this).attr('classid');
var mytext = $.ajax({
type: "POST",
url: "GetCountClass.ashx",
data: { "classid": myid },
async: false
}).responseText;
$(this).html("&nbsp;("+mytext+")");
});
});
</script>

posted @ 2017-10-17 09:05  Future.Net博客  阅读(518)  评论(0编辑  收藏  举报