WebView.InstallCallback
-----------------------

Installs JavaScript callback into web viewer.

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

MBS( "WebView.InstallCallback" ) ### Parameters

none

### Description

Installs JavaScript callback into web viewer.  
This function needs to be called one time to enable JavaScript to reach out from the web viewer to run a FileMaker Script.   
One strategy is to call this function on start-up before any WebViewers have been displayed.  
  
To call back from Javascript to FileMaker, you assign a string to the window.status property:  
  
window.status="Filename:Scriptname"  
or  
window.status="Filename:Scriptname:Parameter"  
  
The Parameter part can contain ":". Filename must include file extensions so FileMaker finds the database file.  
  
You can also call it within a link with "javascript:window.status='Filename:Scriptname:Parameter'". Like this: href="javascript:window.status='callbacks.fp7:Another Script:Hello World'".  
Does not work currently with Internet Explorer 10 on Windows.  
  
Not supported for WebKit 2.x (FileMaker 16 Mac), but works in FileMaker 16, when using a Web Viewer created using [WebView.Create](WebViewCreate.md).  
  
For FileMaker 16, please check [WebView.AddScriptMessageHandler](WebViewAddScriptMessageHandler.md) function as a replacement.  
### Examples

Install Callbacks

 MBS ("WebView.InstallCallback")  
### See also

- [WebView.AddScriptMessageHandler](WebViewAddScriptMessageHandler.md)
- [WebView.Create](WebViewCreate.md)

### Release notes

- **Version 7.5**
    - Changed [WebView.InstallCallback](http://www.mbsplugins.eu/WebViewInstallCallback.shtml) to work in FMP 16 with [WebView.Create](http://www.mbsplugins.eu/WebViewCreate.shtml).

### Example Databases

- [Window/Window Scrollbar Position](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Window/Window%20Scrollbar%20Position.shtml#3ScriptAnchor_)

### Blog Entries

- [Check out options for FileMaker JavaScript Integration](https://www.mbsplugins.de/archive/2020-05-21/Check_out_options_for_FileMake/monkeybreadsoftware_blog_filemaker)
- [FileMaker and WebViewer communication](https://www.mbsplugins.de/archive/2018-08-24/FileMaker_and_WebViewer_commun/monkeybreadsoftware_blog_filemaker)
- [Trigger FileMaker Scripts from JavaScript in FileMaker 16](https://www.mbsplugins.de/archive/2017-12-15/Trigger_FileMaker_Scripts_from/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 7.5pr2](https://www.mbsplugins.de/archive/2017-10-16/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)
- [The Internet Explorer 10 Problem](https://www.mbsplugins.de/archive/2013-07-13/The_Internet_Explorer_10_Probl/monkeybreadsoftware_blog_filemaker)
- [Using a HTML slider in Filemaker with Webviewer and our plugin](https://www.mbsplugins.de/archive/2012-01-29/Using_a_HTML_slider_in_Filemak/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 31st July 2019

  
[WebView.HasParent](WebViewHasParent.md) - [WebView.InstallMultiFileOpenDialog](WebViewInstallMultiFileOpenDialog.md)

[HTML Version](WebViewInstallCallback.shtml)