jSignage Core
jSignage is a jQuery port for SVG Tiny 1.2 uDOM — it simplifies writing JavaScript for digital signage on SpinetiX players. It provides layer constructors, DOM manipulation, event handling, AJAX, data feed parsing, animations, and interactivity.
Loading the Library
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 1920 1080">
<script xlink:href="https://download.spinetix.com/spxjslibs/jSignage.js"/>
<script><![CDATA[
$(function() {
// your code here
});
]]></script>
</svg>The jSignage Object
-
jSignageis the global object added after the library loads -
$is a syntactic sugar alias:$()===jSignage() -
Most methods return the jSignage object itself → chaining:
$.media({...}).fadeIn().addTo('svg')
⚠️ JavaScript Engine: SpiderMonkey 17
CRITICAL CONSTRAINT: SpinetiX players use SpiderMonkey 17 (ES5 era).
NOT Supported
| Feature | Use Instead |
|---|---|
const, let | var |
Arrow functions => | function() {} |
Template literals `${x}` | "str" + x |
Array.forEach/map/filter/reduce | for loops |
Promise, async/await | Callbacks |
class syntax | Constructor functions |
Supported
-
var,function,for,while,do-while -
JSON.parse(),JSON.stringify(),RegExp,try/catch -
Standard
Math,Date,String,Arraymethods (ES5)
Document Ready Pattern
Always wrap code in document ready — ensures the DOM is fully loaded before manipulation:
$(function() {
// ALL code goes here
$.textArea({ fontSize: 60 }).text("Hello World").addTo('svg');
});Global Variables
| Object | Description | Details |
|---|---|---|
jSignage / $ | The jSignage library | jQuery uDOM |
localStorage | Permanent key-value storage | Web Storage |
sessionStorage | Session-scoped storage | Web Storage |
createSharedVariable() | Shared variable access | Shared Variables |
Data Types
| Type | Description |
|---|---|
jSignage Object | Wrapper returned by $() and layer constructors |
Plain Object | { key: value } — attribute objects |
Timer Object | Handle from $.setTimeout / $.setInterval |
Related Pages
- Layers Overview — all layer types and common attributes
- jQuery uDOM Port — selectors, DOM manipulation
- Utilities & Timers — timer methods, loggers
- Player APIs Overview — all available APIs