If jQuery is not loaded, you can still interact with the clara api through plain javascript. The DOM element must be passed in to all commands as the ‘el‘ attribute.
This still requires that you specify the Lightning JS code snippet in your web page tough.
init is used to initialize the player. The player must be initialized before sending any further commands.
var element = document.getElementById('my-clara-scene');
clara('init', {el: element, id: 'uuid', loadingImg: '/img/splash.jpg'});
The clara function returns a Javascript promise that allows you to execute a function after the scene is loaded.
clara('init', {el: element, id: 'uuid', loadingImg: '/img/splash.jpg'}).then(function() {
alert('player started');
});
You can also run the commands:
clara('fullscreen', {el: element});
clara('script', {el: element, fn: function(ctx) {}});
clara('assignMaterial', {el: element, material: 'RedFabric', assignTo: 'ChairMesh'});