Thanks to some much-appreciated help Michel B gave me a while back and another post, the code below at least allows me to display an alert of the contents of the div in the webhtmlviewer, and also alert the url of the file being displayed in the webhtmlviewer, but what further code do I need to get the contents of the div in the webhtmlviewer returned back into a variable in Xojo?
dim theelementid as string = "inputdiv"
dim thejavascript as string
thejavascript = thejavascript + "var HTMLViewer= document.getElementById('"+HTMLViewer1.ControlID+"');"
thejavascript = thejavascript + "var VieweriFrame=HTMLViewer.getElementsByTagName('iframe');"
thejavascript = thejavascript + "var viewerDom=VieweriFrame[0].contentDocument ;"
//alert the url
thejavascript = thejavascript + "alert(VieweriFrame[0].contentWindow.location.href);"
//alert the div contents
thejavascript = thejavascript + "alert(viewerDom.getElementById('"+theelementid+"').innerHTML);"
HTMLViewer1.ExecuteJavaScript(thejavascript)
The div contains up to 200 lines of html.
Thanks in advance!