1. 程式人生 > >Jquery each ajax 賦值

Jquery each ajax 賦值

async ntc set document attr etc class javascrip esp

<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>

Jquery each ajax 賦值