views:

52

answers:

1

I have this JavaScript function which is working in all the machines I tried except the one that is running on Vista. I am calling this function onload. what do you think is wrong with this one.

function isePad() {
    var epad;
    epad = window.document.esCapture1.ConnectedDevice;

    if (!epad) {
        alert('Sorry epad either is not Connected or/and drivers are not installed');
    }
}
A: 

esCapture1 probably does not exist - You should check for it first:

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'); 
    } 
} 
jball