<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(" ("+mytext+")");
?????????????});
?????????});
???</script>
Jquery each ?ajax ?赋值
原文地址:http://www.cnblogs.com/future/p/7679924.html