I have a button which links to another page. Before I click that link, I want to check if that page currently returns an error or if it is not existing. How can I code this? Is this possible? I want to disable the link if it is not existing or if it returns an error.
You could use ajax to load the page and then parse it to see if there's an error before you then redirect the user. I would also include some kind of note to the user as to why the link isn't working.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With