Questions or comments about this article? Please post at the bottom of this page

Follow

WODTogether SDK for Javascript

The WODTogether SDK for JavaScript doesn't have any standalone files that need to be downloaded or installed, instead you simply need to include a short piece of regular JavaScript in your HTML that will asynchronously load the SDK into your pages. The async load means that it does not block loading other elements of your page.

The following snippet of code will give the basic version of the SDK where the options are set to their most common defaults. You should insert it directly after the opening <body> tag on each page you want to load it:

<script type="text/javascript">
(function(d, s, id){
 var js, wjs = d.getElementsByTagName(s)[0];
 if (d.getElementById(id)) {return;}
 js = d.createElement(s); js.id = id;
 js.src = "//wodtogether.com/js/widgets/widget-loader.js";
 wjs.parentNode.insertBefore(js, wjs);
}(document, 'script', 'wodtogether-jssdk'));
</script>

This code will load and initialize the SDK. Next you just add the appropriate widget markup (see the other articles in this section for details)

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Section Articles

loading...

Have Feedback?

Comments


Powered by Zendesk