let req = await fetch('google.com'); let hasConnection = req.status === 200;
giving me an error
Hi,
Forgive me for this very late reply.
I am presuming you are getting the error when running it on iOS.
I had not taken into consideration that any network requests on iOS must be https or have the url placed into exception when I was writing this.
https
Please try with the below if you are still stuck on this.
let req = await fetch('https://www.google.com'); let hasConnection = req.status === 200;
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
let req = await fetch('google.com');
let hasConnection = req.status === 200;
giving me an error
Hi,
Forgive me for this very late reply.
I am presuming you are getting the error when running it on iOS.
I had not taken into consideration that any network requests on iOS must be
https
or have the url placed into exception when I was writing this.Please try with the below if you are still stuck on this.