Javascript...End Javascript: Difference between revisions
Jump to navigation
Jump to search
Created page with "JAVASCRIPT <br /> :[statements] <br /> END JAVASCRIPT '''Description''' The JAVASCRIPT statement allows you to ember pure JavaScript in your NS Basic/X program. This allows ..." |
|||
(9 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
JavaScript <br /> | |||
:[statements] <br /> | :[''statements''] <br /> | ||
End JavaScript | |||
== Description == | |||
The | The JavaScript statement allows you to embed pure JavaScript in your app. This allows you to have additional functionality or to reuse functions from other JavaScript projects. Statements within this block must follow all JavaScript rules. Do not put a comment on the JavaScript line. For more information, see the Tech Note ‘[[The role of JavaScript, HTML5 and WebKit|The role of JavaScript and WebKit]]’. | ||
== Example == | |||
<pre> | <pre> | ||
Rem JavaScript…End JavaScript sample | |||
Dim s | Dim s | ||
s = "knuTH" | s = "knuTH" | ||
JavaScript | |||
function UCFirst(str){ | function UCFirst(str){ | ||
// split string | // split string | ||
Line 25: | Line 25: | ||
return firstChar + remainChar | return firstChar + remainChar | ||
} | } | ||
End JavaScript | |||
Print UCFirst(s) | Print UCFirst(s) | ||
</pre> | </pre> | ||
== Output == | |||
<pre> | <pre> | ||
Line 35: | Line 35: | ||
</pre> | </pre> | ||
== Related Items == | |||
[[html| | [[html|Html]] [[Style/End Style]] | ||
[[Category:Language Reference]] | |||
[[Category:Statements - Flow of control]] |
Latest revision as of 02:12, 17 September 2014
JavaScript
- [statements]
End JavaScript
Description
The JavaScript statement allows you to embed pure JavaScript in your app. This allows you to have additional functionality or to reuse functions from other JavaScript projects. Statements within this block must follow all JavaScript rules. Do not put a comment on the JavaScript line. For more information, see the Tech Note ‘The role of JavaScript and WebKit’.
Example
Rem JavaScript…End JavaScript sample Dim s s = "knuTH" JavaScript function UCFirst(str){ // split string firstChar = str.substring(0,1); remainChar = str.substring(1); // convert case firstChar = firstChar.toUpperCase(); remainChar = remainChar.toLowerCase(); return firstChar + remainChar } End JavaScript Print UCFirst(s)
Output
Knuth