我有这个JavaScript函数,它在我尝试的所有机器上工作,除了在Vista上运行的机器。我正在调用此函数onload
。你认为这个错误是什么。
function isePad() {
var epad;
epad = window.document.esCapture1.ConnectedDevice;
if (!epad) {
alert('Sorry epad either is not Connected or/and drivers are not installed');
}
}
答案 0 :(得分:1)
esCapture1
可能不存在 - 您应该首先检查它:
function isePad() {
var epad;
if(window.document.esCapture1){
epad = window.document.esCapture1.ConnectedDevice;
}
if (!epad) {
alert('Sorry epad either is not Connected or/and drivers are not installed');
}
}