Widgets

The JavaScript widgets have been created to make it easier to pull relevant information from our site into yours. The data on joind.in belongs to the community and we hope this makes it simple to use it as you wish!

About the Widgets

There's a few widgets to choose from, and we hope you'll also add your own and share (and maybe clean up our suboptimal javascript!).

NOTE: Each widget relies on jQuery, so if your site doesn't already include this, you'll need the following line in your <head> tag:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" 
type="text/javascript"></script>

The Talk Widget

We've started very simple, and the widgets display the current rating and number of comments for a talk. Here's an example:

It simply shows how many comments there are in total, the current overall rating, and links to the site for people to see the comments or join in.

Put the following into your code, with [talk-id] replaced by the talk whose data you want to show:

<script src="//joind.in/widget/widget.php"></script>
<script>
    joindin.draw([talk-id]);
</script>

The above will put the widget exactly where you put your script tag, but for more control you can also have it replace a named div, like this:

<div id="placeholder"></div>
        <script>
            joindin.draw(3214, "placeholder");
        </script>

The Speaker Widget

The speaker widget works much like the above, but shows a speaker's average rating with a link to their page on the joind.in website:


To use the code, just add the following into the page where you want it:

<script src="//joind.in/widget/widget_speaker.php"></script>
<script>
    joindin_speaker.draw(1);
</script>

This widget also supports placing in a named div (see previous widget)

How It Works

The best explanation is for you to read the JavaScript generated by the /widget/widgets.php file! Basically, it is possible to call the v2 API in a JSONP manner; request a format of JSON and send a callback parameter along with your request, and you will get a response which is JSON wrapped in a callback that your client can use cross-domain.

© Joind.in 2014