This is the documentation of the ssxlib.
To use the ssxlib you need to add the ssxlib.js
and ssxlib_vendors.js
files to the HTML of your survey. In SurveyXact you manage this by adding the following lines to your surveys CSS. Please be sure that these line are outside of the style
tag.
</style>
// ... other code
<script language='javascript' type='text/javascript' src='https://sx.syspons.com/lib/1.0.7/ssxlib_vendors.js'></script>
<script language='javascript' type='text/javascript' src='https://sx.syspons.com/lib/1.0.7/ssxlib.js'></script>
// ... other code
<style>
Find a more detailed description below.
Click on Edit layout
Click on Edit CSS
Enlarge the CSS view
Insert the code
Close the CSS view
Save your changes
To use the library you need to execute it from inside the HTML of your survey. There are different ways to do so. Which way to choose for each function can be found in this documentation.
Some functions need to be included in SurveyXact expressions. For them to be executed when the page is loaded the following code needs to surround the function:
<script language='javascript' type='text/javascript'>
$(document).ready(function() {
// YOUR SSXLIB FUNCTION
})
</script>
For SX to parse the code correctly there must not be any new line statements, and the code needs to be wrapped inside quotes. So it will actually look like this:
"<script language='javascript' type='text/javascript'>$(document).ready(function() { YOUR SSXLIB FUNCTION })</script>"
These functions usually initialize some state in order for other functions to work correctly. Therefore they need to be placed inside an expression once on each survey page on which some other functions that depend on it shall be called.
These functions modify their surroundings, so they need to be placed inside an expression right where it should be used. Where to put such a function exactly is documented further in the functions documentation.
If some code should be added to each page of a survey rather than to several pages you can include the code inside your surveys CSS code.
</style>
// ... other code
<script language='javascript' type='text/javascript'>
$(document).ready(function() {
// some ssxlib code
});
</script>
// ... other code
<style>
If a feature relies on some specific HTML, it is explained in the functions documentation.