Embed mode

The Widget
The Code

It is possible to embed the share widget on a page, instead of having it appear in a modal. This can be accomplished by ensuring the presence of an element with an ID of “janrainEngageShare” and setting “embed” to the boolean true.

The element with an ID of “janrainEngageShare” will then act as the container for the embedded share widget.

<!doctype html>
<head>
<script type="text/javascript">
(function() {
    if (typeof window.janrain !== 'object') window.janrain = {};
    if (typeof window.janrain.settings !== 'object') window.janrain.settings = {};
    if (typeof window.janrain.settings.share !== 'object') window.janrain.settings.share = {};
    if (typeof window.janrain.settings.packages !== 'object') janrain.settings.packages = [];
    janrain.settings.packages.push('share');

    /* _______________ can edit below this line _______________ */

    janrain.settings.share.embed = true;
    janrain.settings.share.message = "Janrain is really amazing.";
    janrain.settings.share.title = "Janrain is awesome!";
    janrain.settings.share.url = "http://janrain.com/";
    janrain.settings.share.description = "Janrain is more awesome than ever before.";

    /* _______________ can edit above this line _______________ */

    function isReady() { janrain.ready = true; };
    if (document.addEventListener) {
        document.addEventListener("DOMContentLoaded", isReady, false);
    } else {
        window.attachEvent('onload', isReady);
    }

    var e = document.createElement('script');
    e.type = 'text/javascript';
    e.id = 'janrainWidgets';

    if (document.location.protocol === 'https:') {
        e.src = 'https://rpxnow.com/js/lib/widget-examples-pro/share_beta.js';
    } else {
        e.src = 'http://widget-cdn.rpxnow.com/js/lib/widget-examples-pro/share_beta.js';
    }

    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(e, s);
})();
</script>
</head>
<body>
<button id="janrainEngageShare"></button>
</body>
</html>

Help Us Improve!

Give us your feedback