Is the .js file generated by php? If not, you can't use PHP code there. Try this to confirm the JavaScript function is working fine:
function confirmDelete(del, id){
var r=confirm("Confirm delete?");
if (r==true){
alert('deleted!');
}
else{
alert('not deleted!');
}
};