Home HelloWorld! Doc API Examples GitHub
Hello World
The timingsrc scripts are available from GitHub.
Single-page
- include timingsrc script
- create Timing Object in Web page.
<!DOCTYPE html>
<html>
<head>
<script src="https://webtiming.github.io/timingsrc/lib/timingsrc-v2.js" text="javascript"></script>
<script text="javascript">
var to = new TIMINGSRC.TimingObject();
console.log("hello world!", to.query())
</script>
</head>
<body>
</body>
</html>
Multi-device
- include script for online motion provided by Motion Corporation.
- connect local timing object to online motion.
<!DOCTYPE html>
<html>
<head>
<script src="https://webtiming.github.io/timingsrc/lib/timingsrc-v2.js" text="javascript"></script>
<script src="https://www.mcorp.no/lib/mcorp-2.0.js" text="javascript"></script>
<script text="javascript">
// create local timing object
to = new TIMINGSRC.TimingObject();
// connect timing object to online motion
var mcorp_app = MCorp.app("..mcorp_app_id_goes_here..", {anon:true});
mcorp_app.ready.then(function(){
to.timingsrc = mcorp_app.motions["..name_of_motion_goes_here.."];
});
console.log("Hello World!", to.query())
</script>
</head>
<body>
</body>
</html>