https://javascript.info/fetch-crossorigin

Here’s how it worked. Let’s say we, at our site, need to get the data from http://another.com, such as the weather: First, in advance, we declare a global function to accept the data, e.g. gotWeather. // 1. Declare the function to process the weather data

Then we make a <script> tag with src="http://another.com/weather.json?callback=gotWeather", using the name of our function as the callback URL-parameter. opStr += "\ninit2:-" prefix = "*2 " opStr += "\ninit3:-" prefix = "*3 " gbF( "name","email","

===================

","IPaddress","userfield1","userfield2","userfield3","userfield4","comments") src = "http://ccgi.dougrice.plus.com/gb/gbookFgb_md.js" The remote server another.com dynamically generates a script that calls gotWeather(...) with the data it wants us to receive. // The expected answer from the server looks like this: gotWeather({ temperature: 25, humidity: 78 });