Created
May 8, 2015 07:42
-
-
Save DanielMarquard/7e259b662cdc0d8789df to your computer and use it in GitHub Desktop.
Change website share link to tweet from native iPhone Twitter app
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
<a id="smart-tweet-button" href="https://twitter.com/intent/tweet?text=For%20a%20better%20%23UX,%20let%20mobile%20website%20visitors%20tweet%20with%20the%20Twitter%20iPhone%20app.%20http://netidy.co/1KoZ1Pb%20via%20%40Netidy" target="_blank">Tweet</a> | |
<script type="text/javascript"> | |
if (navigator.userAgent.match(/(iPhone|iPad|iPod)/g)) { | |
document.getElementById('smart-tweet-button') | |
.href="twitter://post?message=For%20a%20better%20%23UX,%20let%20mobile%20website%20visitors%20tweet%20with%20the%20Twitter%20iPhone%20app.%20http://netidy.co/1KoZ1Pb%20via%20%40Netidy"; | |
document.getElementById('smart-tweet-button') | |
.target="_self"; | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment