所以我有一个评估页面,它通过后 xmlHTTP 加载并插入到我的内容 ID div
function aload(){
a.open("POST","http://crm/247QC/index.php",false);
a.setRequestHeader("Content-type","application/x-www-form-urlencoded");
a.send("java_task=assesment");
document.getElementById("content").innerHTML=a.responseText;
setTimeout(function(){
loadQC();
loadplayer(document.getElementById("leadnumber").innerHTML);
}, 3000);
function loadQC(){
document.getElementById("bts").innerHTML='<button id="qcSub" onClick="qcSubmit()">Submit QC Form</button>';
}
我面临的问题是因为当我点击提交按钮时页面充满了选择下拉列表和输入,然后将其发送到
function qcSubmit(){
var agent = document.getElementById('agent').value;
var phone = document.getElementById('phone').value;
var p = document.getElementById('p').value;
var one = document.getElementById('one').value;
var two = document.getElementById('two').value;
var three = document.getElementById('three').value;
var four = document.getElementById('four').value;
var five = document.getElementById('five').value;
var six = document.getElementById('six').value;
var seven = document.getElementById('seven').value;
var eight = document.getElementById('eight').value;
var nine = document.getElementById('nine').value;
var ten = document.getElementById('ten').value;
var eleven = document.getElementById('eleven').value;
var twelve = document.getElementById('twelve').value;
var thirdteen = document.getElementById('thirdteen').value;
var fourteen = document.getElementById('fourteen').value;
var fifthteen = document.getElementById('fifthteen').value;
var sixteen = document.getElementById('sixteen').value;
var seventeen = document.getElementById('aeventeen').value;
var eighteen = document.getElementById('eighteen').value;
var nineteen = document.getElementById('nineteen').value;
var twenty = document.getElementById('twenty').value;
var note = document.getElementById('comments').value;
//alert("Yes I Ran");
alert(note);
p = 0;
}
它似乎没有抓取任何 div 输入或选择下拉菜单。我想知道为什么会这样。是否存在javascript无法看到xmlHTTP发送到div的限制,因为Javascript文件是在函数运行之前加载的。如果是这种情况,我需要修复它,以便上述功能可以看到并按预期行事。