WebBrowser enhancements

The WebBrowser control supports executing JavaScript by the following functions and events:

  • EvaluateJavascriptAsync function -- Executes JavaScript asynchronously. This function triggers the EvaluateJavascriptFinished event.

    EvaluateJavascriptAsync (string javascript)
  • EvaluateJavascriptSync function -- Executes JavaScript synchronously.

    EvaluateJavascriptSync (string javascript{, ref string result{, ref string error}})
  • RegisterEvent function -- Registers the user defined event so that it can be triggered in JavaScript.

    RegisterEvent (string eventname)
  • UnregisterEvent function -- Unregisters the user defined event that is registered using the RegisterEvent function.

    UnregisterEvent (string eventname)
  • EvaluateJavascriptFinished event -- Triggered after the EvaluateJavascriptAsync function is executed.

    EvaluateJavascriptFinished (string result, string error)
  • PowerBuilder user events can be defined with one string-type parameter and string-type return value and can be registered by RegisterEvent function and then triggered in JavaScript. For more, see the section called “Defining user events for WebBrowser”.

    EventName (string parameter) 

The WebBrowser control supports basic and digest authentications:

  • When the web page to be accessed needs basic or digest authentication, the WebBrowser control will automatically display a login window for the user to enter the user name and password for authentication. If the authentication fails, this window will display again until the authentication is successful or the authentication operation is cancelled.