Browser.call

From GT-MP
Jump to: navigation, search
Browser.call
Client-Side Function
System-users.png Client-Side Javascript.png JavaScript

browser.call allows you to invoke methods in your CEF browser from a clientside script.

This is done by calling browser.call from the clientside script code, and making a function in your JavaScript code that load your browser.

Important! "browser" must be already defined and the CEF page must be fully loaded!

Syntax

In Javascript
Client-Side Function

browser.call(String functionName, Object[] arguments);
  • functionName: parameter input should be in String type.
  • arguments: parameter input should be in Object[] type.


Dialog-warning.png

Note: If local is set to false in the CEF Browser, you will not be able to use this function!


Usage example(s)

// Client-side .js script
var content = "Some Text..";
browser.call("ChangeDiv", content);
<!-- code in .html page, or .js file -->
<script>
  function ChangeDiv (content) {
      // do things... 
  }
</script>


References