Introduction
Introduction
JavaScript is a freely available scripting language that is normally found performing the "work" behind interactive web pages, however its syntax and structure also make it an excellent tool for providing an externally programmable interface to programmes in general.
Within T/HIS it is implemented as an Application Programming Interface (API) which provides a range of functions that allow you to edit and create curves, open windows, generate plots, and so on. This is written in a very simple and non-intimidating way, with relatively few functions, that should be easy for non-programmers to use.
Anyone familiar with C or shell script programming will find existing JavaScripts are instantly readable, and can be given minor edits without further ado. For those who are more ambitious a good guide to the language is " JavaScript, A definitive Guide " by David Flanagan, published by O'Reilly, ISBN 0596101996.
In T/HIS 17.0 and earlier the implementation supported ECMAScript 5 features of JavaScript. In T/HIS 18.0 the implementation has been upgraded to support ECMAScript 6 (and newer) features of JavaScript.
The sections below describe how to run JavaScripts in T/HIS, and summarise its JavaScript API. For details of the API and its functions, and also some examples, see the JavaScript API Reference Manual