Say we have written an analog clock program, and we want to show that clock on a Web Page.
Here is a QB64 program by b+ ported to BAM:
Although you might want to embed a "development" version of your BASIC program (as a preview of your app, and/or for testing purposes), let's assume that your BASIC program has been promoted to the "production" level, and it is the "production" version of the program that we want to embed in some Web Page.
In BAM, click on the "Project" menu. In the "Project" pop-up menu, click on the "Export" menu item (the last item in the menu).
In the "Export Options" dialog, click on "Stand-Alone (PROD):
You will then be prompted with a dialog in which you give the export file a name, and you provide the location where to save that file (the dialog's appearance will vary by Web browser):
The HTML file that has been exported and saved contains everything needed for the BASIC program to run as an independent Web Page: the BASIC program, the transpiler (which at Web Page rendering converts the BASIC program to JavaScript, and whatever else is needed for any proper Web Page.)
To be accessed on the web (either directly as a Web Page, or embedded in an "iframe" HTML element in some other web Page), the HTML file needs to be copied to some Web server that can host "static" Web pages. (The "Run the program" link at the top of this blog article is a link to the HTML file uploaded to my Neocities website.)
To include the exported BASIC program as an app in some webpage, add code like the following to that web page:
<iframe
src="https://basicanywheremachine.neocities.org/sample_programs/Analog%20Clock%20by%20b+.prod.run"
style="width:100%;"/>
Note: for the clock to be embedded in another Web Page, the website hosting the clock's HTML file must be on a Web server that allows pages on that web server to be displayed in pages from other websites.
How's that for a pretty convenient way, if you are a BASIC programmer, to add your own custom apps to any Web Page ???
For example, here's the clock program running in a TiddlyWiki instance (a TiddlyWiki instance, whether stored locally or on the web, behaves a little bit like a single-file Web site):