Javascript: How can I check to see if url to fire exists before firing it?
To test an url you must access it. So, without an external service, you can't test them beforehand.
W3C provides a link checker: https://validator.w3.org/checklink
"The program can be used either as a command line tool or as a CGI script."
Maybe you can use it to test an url and, after, create or not your button.
I don't know if there is a limit for this service, so check the documentation!
http://search.cpan.org/dist/W3C-LinkChecker/bin/checklink.pod
Detect if the iframe content has loaded successfully
Nowadays the browsers have a series of security limitations that keep you away from the content of an iframe (if it isn´t of your domain).
If you really need that functionality, you have to build a server page that have to work as a proxy, that receive the url as a parameter, test if it is a valid url, and does the redirect or display the error page.
Related Topics
How to Move Focus on Next Field When Enter Is Pressed
How to Display a Success Message After Redirecting the User Back to My Home Page
Jquery Ajax Post Results in 500 Internal Server Error
Regex Pattern to Match At Least 1 Number and 1 Character in a String
Expected to Return a Value At the End of Arrow Function Array-Callback-Return on Filter Function
React Native Dynamically Change View's Background Color
How to Force Clients to Refresh JavaScript Files
How to Use Document.Getelementbyid() Method in Typescript
How to Add Active Class/State for Li Element in Reactjs
How to Add Multiple Values in Json Object and Get an Updated Json File
How to Specify Multiple Conditions in an If Statement in JavaScript
Regular Expression to Check Only One Decimal Point
How to Cancel Ongoing Http Requests When There's a New Requests in Angular 6 With Rxjs 6
What's the Best Way to Reload/Refresh an Iframe
Save Image File from Image Url JavaScript HTML
Securityerror: Blocked a Frame With Origin from Accessing a Cross-Origin Frame