There is a slightly clunky mechanism that can pass small amounts of data to an HTML page. I have proved the operation on a standard CasparCG play command, but expect the method to work for a loadbg command.
The method uses a combination of a query attached to the page url, and some simple Javascript to process the query tokens. For example:
http://www.mysite.com:3000/templates/maps01?location=Norway&city=Bergen
Use an initialise function called when the page loads to read the query text using the gloabal window.locataion.search object. This returns the section of the url that starts with the ‘?’ character. If the length of the query string is finite remove this leading ‘?’ character (.split(1)), then divide the query into an array of tokens splitting the residual string at the & character, then split each token using the = character.
I used this process in an example full screen display that can be run as a page in a browser, as a full page in CasparcG (play 1-10 [http]…) or as a CG ADD template. This example uses a fixed size 1920 x 1080 display area. The example has many comments in the html file intended to assist people using the template as a learning exercise. The template overview is available in the readme.md at https://github.com/amwtech/CasparCG_Documentation/tree/main/templates, and the html code is in the Example_03 folder at that address.
Edit Note:
Apologies to anyone who tries my template and sees no train times of arrival. The data API used by the template is provided by Transport for London (TfL). TfL suffered a cyber attack at the start of September 2024, and this has impacted the train time of arrival feed used by the template. TfL hope to restore the feed as soon as possible.