In Xojo Documentation I found an interesting sample see documentation.xojo.com/api/user_interface/web/webhtmlviewer.html#webhtmlviewer-loadhtml but is not working:
Var js As String = "<script type=""text/javascript"">document.write(""Hello World!"")</script>"
Var html As String = "<html><body>" + js + "</body></html>"
HTMLViewer1.LoadHTML(html)
I’m trying to write something into a WebHTMLViewer control but I need help:
On Button pressed:
Sub Pressed()
Method_Write_something(HTMLViewer1.ControlID)
End Sub
Method:
Sub Method_Write_something(InnerControlID As String)
Var code() As String
code.AddRow "function Write_something(parameter) {"
code.AddRow "var elmnt = document.getElementById(parameter);"
code.AddRow "var content = 'Hello World!';"
code.AddRow "elmnt.html = content;"
code.AddRow "};"
code.AddRow "Write_something('" + InnerControlID + "')"
ExecuteJavaScript(String.FromArray(code, EndOfLine.Windows))
End Sub
I suppose it is not Able to identify the HTMLViewer1 content…
Could please somebody help me?