Actually I need to check the file or image that is already existed or not in our local c or d drive. how do I achieve it.?
here is my code.
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
function checkIfFileLoaded(fileName) {
$.get(fileName, function(data, textStatus) {
if (textStatus == "success") {
// execute a success code
console.log("file loaded!");
}
});
}
$("p").click(function(){
checkIfFileLoaded("C:\\Vignesh Mohanraj\\vignesh.txt");
});
});
</script>
</head>
<body>
<p>click for check</p>
</body>
</html>
Please help me to solve this.