Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
12.0
12.1
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
Statistic
FMM
Blog
JavaScript.New
Creates a new javascript context.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
JavaScriptWebKit | 5.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
JSRef | Available in MBS FileMaker Plugin 12.2 or newer. The desired js reference. Usually each one gets a number assigned, but you can create a JavaScript environment with a fixed name, so you can anywhere reference it by name. |
"JS" | Optional |
Result
Returns reference number or error.
Description
Creates a new javascript context.Reference numbers start at 47000.
Works in FileMaker 32-bit and 64-bit.
Supported for iOS with MBS Plugin 7.5.
Check JS Functions for JavaScript engine cross platform.
Examples
Initialize:
Set Variable [ $r; Value:MBS("JavaScript.New") ]
If [ MBS("IsError") ]
Show Custom Dialog [ Title: "Failed to initialize"; Message: $r; Default Button: “OK” ]
Else
Set Variable [ $$Context; Value:$r ]
Show Custom Dialog [ Message: "OK"; Default Button: “OK” ]
End If
See also
- IsError
- JavaScript.CF
- JavaScript.CheckScriptSyntax
- JavaScript.EvaluateScript
- JavaScript.GetProperty
- JavaScript.List
- JavaScript.RegisterEvaluateFunction
- JavaScript.SetProperty
Release notes
- Version 13.1
- Fixed JavaScript.New to work on iOS again.
- Version 12.2
- Added new parameter for JavaScript.New to name the instance.
Example Databases
- JavaScript/RichTextToJSON
- Mac and iOS/JavaScript/JavaScript
- Mac and iOS/JavaScript/JavaScriptMac Custom Functions
Blog Entries
- Using JavaScript with WebKit on FileMaker Server on Linux
- MBS FileMaker Plugin, version 13.1pr1
- MBS FileMaker Plugin 12.2
- Custom Functions in JavaScript reloaded
- MBS FileMaker Plugin, version 12.2pr5
This function checks for a paid license.
Created 5th November 2015, last changed 9th February 2023
JavaScript.LoadLibrary - JavaScript.RegisterEvaluateFunction
