麻烦老师帮忙看一下 红色代码是能弹出正确值,如果放在 ajax弹出就是错误的
function getkc(){
var lb =document.getElementById('xdlb').innerText
if(lb.length >0){
var li=document.querySelectorAll('#xdlb li');
for(var i= 0; i< li.length; i ++){
var label= li[i].getElementsByTagName("label")
var p= li[i].getElementsByTagName("p")
alert( label[0].nextElementSibling.value )
mui.ajax({
type: "post",
dataType: "json",
data: {
czlb:"zdkccx",
spdm:p[0].innerText,
ck:document.getElementById('ck').value
},
url: "data.htm",
complete :function(){$("#load").hide();},
success: function(msg){
var data = msg;
if( msg && msg.length > 0)
{
//
alert(label[0].nextElementSibling.value )
//inputs[0].value =JSON.stringify(msg[0].spkc )
}
}
});
}
}
}
[此贴子已经被作者于2020/1/21 11:03:26编辑过]