Hey Anas - lovely work on this challenge - it is quite a tricky one!! š
I would suggest the following improvements could be made to your JS;
- I would include some input validation to check the value entered is a URL. At the moment I can try and enter other values and I don't get an indication that this isn't allowed - this will provide some quick and instant feedback to the user
- On successful return of the API call, I would also suggest reverting the input to an empty state - just a nice thing to do for users
- In the API call, I would include a
catch
statement to collect any errors - these can then be shown to the user. This is in case the URL submitted was in the proper format, but for some reason, the response didn't work out.
If you check the response in the dev tools you can see that the response from this API has some useful error messages that can be shown to the user.
Hope this helps a little!
Cheers Dave
Marked as helpful
0
anas aliā¢ 415
@anas-cd
Posted
@dwhenson thanks a lot for these improvements, I will implement them
0