Wisej.Web.WebBrowser.eavl(JS) do not works
In this code, please advise:
Public Class CTreeView_basic_01_ForBooks
Inherits TreeView
Dim OWebBrowser As Wisej.Web.WebBrowser
Public Sub New(INOGuid As Guid, ByRef INoWebBrowser As Wisej.Web.WebBrowser)
OWebBrowser = INoWebBrowser
With Me
.Dock = DockStyle.Fill
.ShowPlusMinus = True
.ShowRootLines = True
.ShowNodeToolTips = True
End With
End Sub
Private Sub CTreeView_basic_01_NodeMouseClick(sender As Object, e As TreeNodeMouseClickEventArgs) Handles Me.NodeMouseClick
Dim OTreeNode As TreeNode = e.Node
Dim searchText As String = OTreeNode.Text
Dim js As String =
“var found = false;
var el = document.body;
if (el.innerText.includes(‘” & searchText.Replace(“”””, “\”””) & “‘)) {
el.style.backgroundColor = ‘yellow’;
found = true;
}
if (!found) alert(‘Nothing Found’);”
OWebBrowser.Eval(js)
End Sub
End Class
Javascript is executed by the browser. So I used google and found why your “code” doesn’t work.
https://stackoverflow.com/ questions/3999101 /get-iframes-document-from-javascript-in- main- document
Hi,
“does not work” means what? Do you get an error in the console?
We need a test case with a clear indication of expected result to check this.
Best regards
Frank
Please login first to submit.