I want to check if a file exists locally, where the HTML file is located. It has to be JavaScript. JavaScript will never be disabled. jQuery is not good but can do.
Try this:
window.onclick=(function(){
try {
var file = window.open("file://mnt/sdcard/download/Click.ogg");
setTimeout('file.close()', 100);
setTimeout("alert('Audio file found. Have a nice day!');", 101);
} catch(err) {
var wantstodl=confirm("Warning:\n the file, Click.ogg is not found.\n do you want to download it?\n "+err.message);
if (wantstodl) {
window.open("https://www.dropbox.com/s/qs9v6g2vru32xoe/Click.ogg?dl=1"); //downloads the audio file
}
}
});