我曾经在我的输入字段的onclick方法加载功能如何从复选框选中时
<td> <input type="checkbox" name="checkbox1" onclick="load();" value="Bike">Include previous service terms</td>
这里删除值函数
<script type ="text/javascript">
function load() {
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
} else {
xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
}
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById('show').innerHTML = xmlhttp.responseText;
}
}
xmlhttp.open('GET','include.inc.php', true);
xmlhttp.send();
}
</script>
但我想不出如何删除复选框时显示的值。我已经尝试了以前提出的问题的答案,但它显示了我的NetBeans中的语法错误
轻微的建议,你可以看看使用jQuery。在我看来,使AJAX变得更容易。 –
克蒙人,不要那样做。它甚至不是ajax问题 – Jesse