Created
March 31, 2014 15:28
-
-
Save renoirb/9894922 to your computer and use it in GitHub Desktop.
Add WebPlatform Docs Annotations to any document
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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