When loading a URL, I want to display an error message immediately if the URL is invalid.
Currently, I have set an interval of 1 second on the function that checks the validity of the URL. However, the error message only appears when I click on an empty area of the screen.
How can I ensure that the error message is displayed as soon as the URL loads?
This is the code I am using:
timer = setInterval(function() {
$scope.ValidateUrl();
}, 1000);