Sharing Widget

Share Widget with Default Settings

The Widget
The Code

This is the widget with customizations loaded from the Janrain server. The following code is the minimum code you need to get the widget up and running on your site. (Javascript in <head> runs asynchronously – will not slow page load.)

Note that there are optional “message”, “title”, “url”, and “description” settings present. These are not required for the widget to load, but are not provided by the server. If these settings are to be taken advantage of, they must be present in this code or set via the JavaScript API.

<!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.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">Share</button>
</body>
</html>

Help Us Improve!

Give us your feedback