The following does not seem to be working properly.
success: function(results)
{
var $results = $(results);
$results.find('a[href$=".exe"]').each(function(){
if (FileExists(this.href) == false) {
$(this).parent().remove();
}
});
$("#divSearchResults").empty().append($results);
}
It should be removing any .exe links from results then appending the modified results to screen.
EDIT 1: Here is the script for the FileExists function:
function FileExists(path) {
var fso = new ActiveXObject("Scripting.FileSystemObject");
FileExist = fso.FileExists(path);
if (FileExist == true) {
return true
} else {
return false
}
}
EDIT 2: results contains something like this:
<div><a href="link1.xls">link 1</a></div>
<div><a href="link2.exe">link 2</a></div>
<div><a href="link3.doc">link 3</a></div>
<div><a href="link4.aspx">link 4</a></div>