How to check whether an HTML file with a specified URL exist on the web server using javascript and if not redirect to an alternative URL

Thanks in advance

ipromote