More thoughts on the Fetch API
In an attempt to get the Fetch API technique to retrieve a stored IP address from a file I ran into a few issues regarding the understanding on how the Fetch API actually works.
The examples on the MSN website give a clue to why it it not easy to understand how the Fetch API works.
The primary example uses some more advanced techniques such as Arrow functions and other aspect of asynchrous data transfers. At the moment I am still at loss to see exactly what is going on.
My requirement was to download the IP address from a file that I had previously setup to contain my current IP address. As the IP address is "dynamic" and subject to change - none the less of access from a different location, I wanted to be able to determine if the access to a page was made by me and not another visitor on the Internet. The main reason for this was that I wanted to place "research links" on pages that actually accessed these external sites but I did not want to provide this facility to other visitors.
My current IP address was to be stored in a file called ip.txt. If this was the same as my current IP address it was okay to display the "research link".
The stored IP address needed to be a var(aible) that could be "seen" by the other Javascript controlling the display of the link.
Another example using await - async and await
The stored IP address is retrieved from ip.txt. This needs to be run fron the server and use the Console F12