87,993
社区成员
发帖
与我相关
我的任务
分享
<div style="margin: 30px;">
<input type="checkbox" name="checkbox" value="1"/>1
<input type="checkbox" name="checkbox" value="2"/>2
<input type="checkbox" name="checkbox" value="3"/>3
<input type="checkbox" name="checkbox" value="4"/>4
<input type="checkbox" name="checkbox" value="5"/>5
<input type="button" value="查询" onclick="search()"/>
</div>
function search(){
$("input[name='checkbox']:checked").each(function(){ //循环
a($(this).val()); //a.txt获取成功后获取b.txt,算一个循环,在次从选中的第二个内容循环
})
}
function a(id){
$.ajax({
type: "get",
url: 'a.txt?id='+id,
async:true, //要异步
success: function (xmlDoc, textStatus, xhr) {
b(id)
}
});
}
function b(id){
$.ajax({
type: "get",
url: 'b.txt?id='+id,
async:true, //要异步
success: function (xmlDoc, textStatus, xhr) {
}
});
}
