Xdialog, HTML, and JavaScript - a Powerful Combination


A brief guide to using xdialog, html, and javascript in combination.

This example show how you can:

  1. Embed a browser object in an Xdialog.

  2. Respond to events in the HTML with Xbasic.

  3. Construct Javascript code using Xbasic and then send that code to the browser object where it is executed.



Create a ContextEval object and give it a unique name so that it is possible to run multiple instances of this script.

dim XbasicCtxName as c
XbasicCtxName = "MyContextEval" + time("hms3")
' dim ContextEval object
dim XbasicCtx as p
XbasicCtx = ole.create("a5contexteval.contexteval")
' attach then ContextEval object to Alpha Anywhere

Set up the HTML that will be displayed in the browser object on the Xdialog. The ContextEval name is represented by the place holder: {CTXEVALNAME}.

dim html as C
html = <<%html%

Must set this property in order to make XP Themes render in IE ActiveX control. This control will allow the HTML and Alpha Anywhere to communicate.

These functions handle communications with Xbasic. Grab the ContextEval object.


Notice when you click one of the buttons, Xbasic handles the event.


Type Javascript code in the textbox below.