I am writing code to download a pdf file using window.open(). I am passing the url of the pdf file on the server.
window.open(url, name, "width=910,height=750,scrollbars=yes");
I want to check if the file was uploaded successfully. What is the return type window.open()?
I tried like this
try
{
window.open(url, name, "width=910,height=750,scrollbars=yes");
alert("success");
}
catch(e)
{
alert("failer");
}
When I change the URL to the wrong URL, it shows the same result as success.
source
share