1

我正在尝试使用 Ajax 从后端(perl)加载页面内容。然后尝试使用简单的 CGIHTTPServer 时,页面将根据需要加载,尤其是 Div 的。

但是当我移到 Apache Server 的同一页面时,内容没有加载。我也没有收到任何错误..:(

如何调试此错误....?

<script type="text/javascript">
$(onload)
function onload() {
$.ajax({
             type: 'POST',
                 url: '/cgi-bin/onload.pl',
             async: false,
success: function(data) {
$('[key]',data).each(function(){
$('[name=chk_'+$(this).attr('key')+']').attr('checked',true)
})
}
})
}
</script>

<body>
<form>
<input name='chk_0' type='checkbox' />0<br />
<input name='chk_1' type='checkbox' />1<br />
<input name='chk_2' type='checkbox' />2<br />
<input name='chk_3' type='checkbox' />3<br />
<input name='chk_4' type='checkbox' />4<br />
<input name='chk_5' type='checkbox' />5<br />
<input name='chk_6' type='checkbox' />6<br />
<input name='chk_7' type='checkbox' />7<br />
<input name='chk_8' type='checkbox' />8<br />
<input name='chk_9' type='checkbox' />9<br />
<input name='chk_10' type='checkbox' />10<br />
<input name='chk_11' type='checkbox' />11<br />
<input name='chk_12' type='checkbox' />12<br />
<input name='chk_13' type='checkbox' />13<br />
<input name='chk_14' type='checkbox' />14<br />
<input name='chk_15' type='checkbox' />15<br />
</form>
</body>
4

0 回答 0