Entry
TSE: Language: Computer: Compile: JavaScript: How to run JavaScript from TSE v2.5?
Oct 4th, 2003 14:19
Knud van Eeden,
----------------------------------------------------------------------
--- Knud van Eeden --- 19 February 2002 - 10:53 pm -------------------
TSE: Language: Computer: Compile: JavaScript: How to run JavaScript
from TSE v2.5?
---
Steps: Overview:
1. create a batchfile 'comJavaS.bat', containing this text
(adapt it to your system) and store this batchfile in your TSE
directory
(e.g. save to c:\mytsedirectory\comJavaS.bat)
(it is also assumed here that you store your JavaScript files with the
extension .js, so that you have to rename it to .htm, in order to
be run correctly later in your browser. If not so, then run your
JavaScript code as described in the HTML part).
@COPY %3 %1.htm
@START %1.htm
@PAUSE
@DEL %1.htm
@EXIT
2. Adapt the compiler information
(in TSE, after loading any file, press <SHIFT><F9>
then 'D' for debug compiler setup
then <ALT><C> to copy one of the compiler settings present
then change the fields:
'Extension' to: .js
'Description' to: JavaScript
'Command' to: c:\mytsedirectory\comJavaS.bat &name& &ext& &fn& >
&output&
make sure this information is permanently stored in the compiler
information (via <ENTER>, then <ESCAPE>)
3. If you now load a .JavaScript file, fill in some program code for
JavaScript,
for example type or copy this text in a file 'mytest.js'
<HTML>
<HEAD>
<TITLE>
</TITLE>
</HEAD>
<BODY
onLoad='
PROCMessage( "Hello World from JavaScript" );
'
>
</BODY>
</HTML>
// --- LIBRARY --- //
<SCRIPT LANGUAGE = "JavaScript">
<!--
<!-- library: message: central [kn, ri, mo, 25-06-2001 13:44:41] -->
function PROCMessage( s ) {
alert( s );
}
// -->
</SCRIPT>
save that text in your TSE directory,
then press <CTRL><F9> or <ESCAPE><M><C> to compile, this will run
that
batch file, which first copies your file to a .htm file,
then starts your browser with that .htm file.
---
---
Internet: see also:
Computer: Wordprocessor: TSE: Language: Computer: Compile: Run:
Overview
http://www.faqts.com/knowledge_base/view.phtml/aid/24311/fid/895
----------------------------------------------------------------------