Javascript Toolkit Libary is a collection of common javascript functions that I've written and found useful over time.
Anyone that's tried to create a GuideMe has probably had to write some javascript. Those that have tried might have noticed that doing certain things in javascript are rather difficult. Many of us have probably started writing our own little libraries to accomplish these things. Rather than everyone writing their own version of common functions, I wanted to share what I have and make it easier for others looking for the same functions.
This library has been extremely helpful to me, I hope this would also be helpful to many others. Below you will find instructions and documentation of all the functions in the toolkit. Enjoy!
Instructions for downloading and adding this library to your tease:
- 1. Download the zip file here: jstoolkit.zip
2. Extract the .js file to your tease's media folder
3. Include the file to your tease: <Include file="jstoolkit.js" />
Sample Tease using js.trim() function:
Code: Select all
<Tease>
<Title>Javascript Toolkit Example</Title>
<MediaDirectory>Data</MediaDirectory>
<Include file="jstoolkit.js" />
<Pages>
<Page id="start" >
<javascript>
<![CDATA[
function pageLoad() {
var text = js.trim(" Trim Leading and trailing spaces! ");
scriptVars.put("vText", "[" + text + "]");
}
]]>
</javascript>
<Text>
<span>vText</span>
</Text>
</Page>
<Pages>
</Tease>



