Skip to content

Instantly share code, notes, and snippets.

@renoirb
Created March 31, 2014 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save renoirb/9894922 to your computer and use it in GitHub Desktop.
Save renoirb/9894922 to your computer and use it in GitHub Desktop.
Add WebPlatform Docs Annotations to any document
<script>
(function () {
var ssl = !! document.location.protocol.match(/^https:/),
embedUrl = 'http://notes.webplatform.org/app/embed.js';
if (ssl && !embedUrl.match(/^https:/)) {
var msg = ['Sorry, but this service is unavailable on pages ',
'served with HTTPS at this time. Please contact support for ',
'further assistance.'];
alert(msg.join(''));
}
else {
var embed = document.createElement('script');
embed.setAttribute('src', embedUrl);
document.body.appendChild(embed);
}
})();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment