The HTML can send messages to its creating widget/script using
var html = "<html><body>";
html += "<button onclick='window.parent.postMessage(\"Hello!\", \"*\")'>Click me</button>";
html += "</body></html>";
Framework.ChartChange({
mode: "active", // or "all", or "single" plus a .chartId value
command: "create-html",
options: {
html: html,
…
}
});
You can receive these notifications from the HTML using an OnMessage() handler, and listening for the
// Listen for messages from the HTML
Framework.OnMessage = function(Msg) {
if (Msg.is(FXB.MessageTypes.CHART_HTML_MESSAGE)) {
// Msg.data contains the message from the HTML
}
};