Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable HTML link if the URL's link returns an error

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.

like image 953
newbie Avatar asked Aug 17 '12 21:08

newbie


Video Answer


1 Answers

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.

like image 167
Jordan Avatar answered Oct 13 '22 00:10

Jordan