1. Steven Green
  2. PowerBuilder
  3. Wednesday, 13 October 2021 01:32 AM UTC
We currently use the MS Ole Control extensively for displaying web content and dynamically interacting with Javascript via the OLE control. 
I want to move to the web Browser Control , I have read Appeon documents however there doesnt seem to be information on how to do the following PB Script ls_text = ole_control.object.document.documentElement.innerHTML ole_control.Object.Document.ParentWindow.ExecScript("javascript:resizemap('"+ ls_whstr + "');")
René Ullrich Accepted Answer Pending Moderation
  1. Wednesday, 13 October 2021 05:50 AM UTC
  2. PowerBuilder
  3. # 1

Hi Steven,

To access page content or to run javascript you have to use the functions EvaluateJavascriptSync or EvaluateJavascriptAsync.

To get the innerHtml:

string ls_text, ls_error
EvaluateJavascriptSync ("document.documentElement.innerHTML", ls_text, ls_error)

ls_text contains JSON with the value(s) the javascript returns. You have to extract the innerHTML from JSON. You can find some examples in PB help.

 

To call your resizemap javascript function you can also use EvaluateJavascritSync function.

HTN.

René

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.