WebView.CallFunction
--------------------

Calls a JavaScript function.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [WebView](component_WebView.md) | [10.0](newinversion100.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ✅ Yes |

MBS( "WebView.CallFunction"; WebViewerRef; FunctionName { ; Parameters... } ) 

**MBS**( **"WebView.CallFunction";** /\* Calls a JavaScript function. \*/  
**$WebViewerRef**; /\* Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function. \*/   
**$FunctionName**; /\* The function name.e.g. "test" \*/   
**$Parameters...**) /\* Optional; Pass as many parameters as needed.e.g. "Hello" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| WebViewerRef | Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function. |  |  |
| FunctionName | The function name. | "test" |  |
| Parameters... | Pass as many parameters as needed. | "Hello" | Optional |

### Result

Returns OK or error.

### Description

Calls a JavaScript function.  
Returns result as text or number.  
You can pass as many parameters as needed.  
  
Added iOS and macOS support for version 11.5.  
  
This function takes variable number of parameters. Pass as much parameters as needed separated by the semicolon in FileMaker.  
Please repeat Parameters parameter as often as you need.  
### Examples

Call with 2 parameters:

 MBS ( "Webview.CallFunction"; "web"; "test"; "Hello"; "World")  
### See also

- [WebView.FindByName](WebViewFindByName.md)

### Release notes

- **Version 11.5**
    - Added [WebView.CallFunction](https://www.mbsplugins.eu/WebViewCallFunction.shtml) for MacOS and iOS.
- **Version 10.0**
    - Added [WebView.CallFunction](https://www.mbsplugins.eu/WebViewCallFunction.shtml) to call any [JavaScript](https://www.mbsplugins.eu/component_JavaScript.shtml) function on Windows.

### Blog Entries

- [Neues MBS FileMaker Plugin 11.5 - Über 6600 Funktionen in einem Plugin](https://www.mbsplugins.de/archive/2021-11-16/Neues_MBS_FileMaker_Plugin_115/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 11.5](https://www.mbsplugins.de/archive/2021-11-16/MBS_FileMaker_Plugin_115/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 11.5pr1](https://www.mbsplugins.de/archive/2021-10-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [New in the MBS FileMaker Plugin 10.0](https://www.mbsplugins.de/archive/2020-01-23/New_in_the_MBS_FileMaker_Plugi/monkeybreadsoftware_blog_filemaker)
- [Neues MBS FileMaker Plugin 10.0](https://www.mbsplugins.de/archive/2020-01-14/Neues_MBS_FileMaker_Plugin_100/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 10.0 - More than 6000 Functions In One Plugin](https://www.mbsplugins.de/archive/2020-01-14/MBS_FileMaker_Plugin_100_-_Mor/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 10.0pr6](https://www.mbsplugins.de/archive/2020-01-06/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 4th January 2020 , last changed 28th September 2021

  
[WebView.AllowsAnyHTTPSCertificateForHost](WebViewAllowsAnyHTTPSCertificateForHost.md) - [WebView.CanResetPageZoom](WebViewCanResetPageZoom.md)

[HTML Version](WebviewCallFunction.shtml)