我有这个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');
}
}发布于 2010-01-21 02:05:55
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');
}
} https://stackoverflow.com/questions/2103641
复制相似问题