WebView.LoadHTML
----------------

Loads HTML string to WebViewer.

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

MBS( "WebView.LoadHTML"; WebViewerRef; HTMLString { ; URL } ) 

**MBS**( **"WebView.LoadHTML";** /\* Loads HTML string to WebViewer. \*/  
**$WebViewerRef**; /\* Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function. \*/   
**$HTMLString**; /\* The HTML String.e.g. "&lt;P&gt;Hello World&lt;/P&gt;" \*/   
**$URL**) /\* Optional; The base URL for finding relative resources like images. (mac only)e.g. "http://www.mbsplugins.de" \*/ 

### 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. |  |  |
| HTMLString | The HTML String. | "&lt;P&gt;Hello World&lt;/P&gt;" |  |
| URL | The base URL for finding relative resources like images. (mac only) | "http://www.mbsplugins.de" | Optional |

### Result

Returns OK or error.

### Description

Loads HTML string to WebViewer.  
Added Windows support with version 5.1.  
On Windows you may need to reset WebViewer before or load "about:blank" to initialize the WebViewer by FileMaker.  
### Examples

Load HTML:

 Set Variable \[ $r ; Value: MBS ("WebView.LoadHTML"; "web"; Editable Webview::HTMLText ) \]  
### See also

- [Text.HTMLtoStyledText](TextHTMLtoStyledText.md)
- [WebView.FindByName](WebViewFindByName.md)
- [WebView.LoadURL](WebViewLoadURL.md)
- [WebView.SetDrawsBackground](WebViewSetDrawsBackground.md)

### Example Databases

- [Mac only/RichText/Write Document](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20only/RichText/Write%20Document.shtml#1ScriptAnchor_)
- [Overlay](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Overlay.shtml#15ScriptAnchor_)
- [Utility functions/MarkDown](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Utility%20functions/MarkDown.shtml#1ScriptAnchor_)
- [WebViewer/Editable Webview](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebViewer/Editable%20Webview.shtml#2ScriptAnchor_)

### Blog Entries

- [Add a WebViewer to an Overlay window](https://www.mbsplugins.de/archive/2024-11-13/Add_a_WebViewer_to_an_Overlay_/monkeybreadsoftware_blog_filemaker)
- [FileMaker and WebViewer communication](https://www.mbsplugins.de/archive/2018-08-24/FileMaker_and_WebViewer_commun/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 5.4pr1](https://www.mbsplugins.de/archive/2015-10-11/MBS_FileMaker_Plugin_version_5/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 5.1pr5](https://www.mbsplugins.de/archive/2015-04-14/MBS_FileMaker_Plugin_version_5/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 3.0pr8](https://www.mbsplugins.de/archive/2012-11-14/MBS_Filemaker_Plugin_version_3/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 3/2024, Seite 33 bis 34](https://filemaker-magazin.de/neuigkeit/4263-Appetithappen-FMM_202403)

This function checks for a license.

Created 18th August 2014 , last changed 4th November 2021

  
[WebView.List](WebViewList.md) - [WebView.LoadJavascriptURL](WebViewLoadJavascriptURL.md)

[HTML Version](WebViewLoadHTML.shtml)