Skip to content

Instantly share code, notes, and snippets.

@superfeedr
Created May 29, 2012 11:09
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 superfeedr/2827860 to your computer and use it in GitHub Desktop.
Save superfeedr/2827860 to your computer and use it in GitHub Desktop.
<button onclick="share();">Share</button>
<script>
function share() {
var intent = new WebKitIntent("http://webintents.org/share", "text/uri-list", this.urlToShare);
var onSuccess = function(data) {
// Successful sharing
};
var onError = function(data) {
// User canceled sharing
};
window.navigator.webkitStartActivity(intent, onSuccess, onError);
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment