Component: JavaScript 
----------------------

Run Javascript without Webviewer cross-platform, even on server.

Our [JavaScript](component_JavaScript.md) functions use DukTape as engine for cross-platform JavaScript, while the [JavaScriptWebKit](component_JavaScriptWebKit.md) functions use WebKit on macOS/iOS (added Windows and Linux in v13.1).

| Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|
| [10.0](newinversion100.md "First functions introduced with version 10.0.") / [11.3](newinversion113.md "Newest functions in version 11.3.") | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

  
| Item | Details |
|:--|:--|
| [JS.AddFileMakerEvaluateFunction](JSAddFileMakerEvaluateFunction.md)   Adds an Evaluate function. | All   10.0 |
| [JS.AddFileMakerRunScriptFunction](JSAddFileMakerRunScriptFunction.md)   Adds a function to start scripts from JavaScript. | All   10.0 |
| [JS.AddFileMakerSQLFunction](JSAddFileMakerSQLFunction.md)   Defines a SQL Evaluate function for JavaScript. | All   10.0 |
| [JS.AddFunction](JSAddFunction.md)   Adds a global function defined as a text string. | All   10.0 |
| [JS.CF](JSCF.md)   Calls a global function given the name with FileMaker values. | All   11.3 |
| [JS.CallFunction](JSCallFunction.md)   Calls a global function given the name with JSON data. | All   10.0 |
| [JS.CallFunctionValues](JSCallFunctionValues.md)   Calls a global function given the name with FileMaker values. | All   11.3 |
| [JS.Evaluate](JSEvaluate.md)   Evaluates a JavaScript expression. | All   10.0 |
| [JS.EvaluateToString](JSEvaluateToString.md)   Evaluates a JavaScript expression. | All   10.0 |
| [JS.GetGlobalProperty](JSGetGlobalProperty.md)   Queries global property. | All   10.0 |
| [JS.GetGlobalPropertyValue](JSGetGlobalPropertyValue.md)   Queries global property. | All   10.0 |
| [JS.InitModules](JSInitModules.md)   Installs Duktape module loading. | All   11.2 |
| [JS.List](JSList.md)   Lists all JavaScript object references. | All   11.3 |
| [JS.New](JSNew.md)   Creates a new JavaScript engine instance. | All   10.0 |
| [JS.Now](JSNow.md)   Queries current time as double value. | All   10.1 |
| [JS.ObjectCount](JSObjectCount.md)   Queries global object counter. | All   10.1 |
| [JS.Release](JSRelease.md)   Frees the JavaScript engine. | All   10.0 |
| [JS.ReleaseAll](JSReleaseAll.md)   Release all JavaScript environments. | All   10.5 |
| [JS.SetGlobalProperty](JSSetGlobalProperty.md)   Sets a global property. | All   10.0 |
| [JS.SetGlobalPropertyValue](JSSetGlobalPropertyValue.md)   Sets a global property. | All   10.0 |
| [JS.StringCount](JSStringCount.md)   Queries global string counter. | All   10.1 |
| [JS.TimeToDateComponents](JSTimeToDateComponents.md)   Converts time to date components. | All   10.1 |
| [JS.TimeToUTCDate](JSTimeToUTCDate.md)   Converts time value to timestamp. | All   10.1 |
| [JS.UTCDateToTime](JSUTCDateToTime.md)   Converts date to time value. | All   10.1 |

24 functions shown.

These functions require a license (92%).

### Release notes

- **Version 13.2**
    - Fixed [JavaScript.Available](https://www.mbsplugins.eu/JavaScriptAvailable.shtml) to return 1 on macOS and iOS, broken in 13.1.
- **Version 13.1**
    - Added [JavaScript.LoadLibrary](https://www.mbsplugins.eu/JavaScriptLoadLibrary.shtml) and [JavaScript.Available](https://www.mbsplugins.eu/JavaScriptAvailable.shtml) functions.
    - Fixed [JavaScript.New](https://www.mbsplugins.eu/JavaScriptNew.shtml) to work on iOS again.
- **Version 13.0**
    - Added [JavaScript.List](https://www.mbsplugins.eu/JavaScriptList.shtml) function.
- **Version 12.2**
    - Added [JavaScript.CallFunction](https://www.mbsplugins.eu/JavaScriptCallFunction.shtml), [JavaScript.GetPropertyJSON](https://www.mbsplugins.eu/JavaScriptGetPropertyJSON.shtml) and [JavaScript.SetPropertyJSON](https://www.mbsplugins.eu/JavaScriptSetPropertyJSON.shtml) functions.
    - Added [JavaScript.CF](https://www.mbsplugins.eu/JavaScriptCF.shtml) function for using this JavaScript engine for custom functions, too.
    - Added new parameter for [JavaScript.New](https://www.mbsplugins.eu/JavaScriptNew.shtml) to name the instance.
- **Version 10.5**
    - Added [AVExport.ReleaseAll](https://www.mbsplugins.eu/AVExportReleaseAll.shtml), [AVRecorder.ReleaseAll](https://www.mbsplugins.eu/AVRecorderReleaseAll.shtml), [CoreML.ReleaseAll](https://www.mbsplugins.eu/CoreMLReleaseAll.shtml), [DNSLookup.ReleaseAll](https://www.mbsplugins.eu/DNSLookupReleaseAll.shtml), [Dictionary.ReleaseAll](https://www.mbsplugins.eu/DictionaryReleaseAll.shtml), [FM.SQL.ReleaseAll](https://www.mbsplugins.eu/FMSQLReleaseAll.shtml), [JS.ReleaseAll](https://www.mbsplugins.eu/JSReleaseAll.shtml), [JavaScript.ReleaseAll](https://www.mbsplugins.eu/JavaScriptReleaseAll.shtml), [LDAP.ReleaseAll](https://www.mbsplugins.eu/LDAPReleaseAll.shtml), [PDFKit.ReleaseAll](https://www.mbsplugins.eu/PDFKitReleaseAll.shtml), [PKCS12.ReleaseAll](https://www.mbsplugins.eu/PKCS12ReleaseAll.shtml), [PKCS7.ReleaseAll](https://www.mbsplugins.eu/PKCS7ReleaseAll.shtml), [PKey.ReleaseAll](https://www.mbsplugins.eu/PKeyReleaseAll.shtml), [SSH.ReleaseAll](https://www.mbsplugins.eu/SSHReleaseAll.shtml), [WinSendMail.ReleaseAll](https://www.mbsplugins.eu/WinSendMailReleaseAll.shtml), [WindowsML.ReleaseAll](https://www.mbsplugins.eu/WindowsMLReleaseAll.shtml), [WordFile.ReleaseAll](https://www.mbsplugins.eu/WordFileReleaseAll.shtml), and [X509.ReleaseAll](https://www.mbsplugins.eu/X509ReleaseAll.shtml).
- **Version 10.0**
    - Added our own JavaScript engine to run JavaScript in FileMaker without a web viewer: [JS](https://www.mbsplugins.eu/component_JS.shtml) functions.

### Blog Entries

- [Custom Functions in JavaScript reloaded](https://www.mbsplugins.de/archive/2022-05-05/Custom_Functions_in_JavaScript/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 9.6pr2](https://www.mbsplugins.de/archive/2019-12-10/MBS_FileMaker_Plugin_version_9/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 4/2021, Seite 23 bis 25](https://filemaker-magazin.de/neuigkeit/4152-Appetithappen-FMM_202104)
- [Ausgabe 4/2021, Seite 20 bis 21](https://filemaker-magazin.de/neuigkeit/4152-Appetithappen-FMM_202104)
- [Ausgabe 6/2020, Seite 25](https://filemaker-magazin.de/neuigkeit/4118-Appetithappen-FMM_202006)

### Example Databases

- [JavaScript/RichTextToJSON](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/JavaScript/RichTextToJSON.shtml#7CustomFunctionAnchor_)
- [JavaScript WebKit/JavaScript](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/JavaScript%20WebKit/JavaScript.shtml#1ScriptAnchor_)
- [JavaScript WebKit/JavaScriptMac Custom Functions](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/JavaScript%20WebKit/JavaScriptMac%20Custom%20Functions.shtml#12912FieldAnchor_)

[HTML Version](component_JS.shtml)