Created
July 9, 2011 17:38
-
-
Save machristie/1073778 to your computer and use it in GitHub Desktop.
Update the tweet text of the iframe Tweet Button
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
function updateTweetButtonText(message) { | |
var tweetButton = document.getElementById('tweet-button'); | |
tweetButton.src = tweetButton.src.replace(/&text=[^&]+/, "&text=" + encodeURIComponent(message) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment