I have a link say TestLink.
Clicking on which normally yields me a pdf.
Sometimes it diplays a page in a new window with message file not found
I need to respond when second case happens ,how do i handle this case via javascript?
I have a link say TestLink.
Clicking on which normally yields me a pdf.
Sometimes it diplays a page in a new window with message file not found
I need to respond when second case happens ,how do i handle this case via javascript?
You could use jQuery
$.ajax( "http://link.to.pdf" )
.fail(function() {
// ... disable the link --> PDF is not reachable
});
You can check the link, if the PDF is not reachable disable the link.