Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save alexkolson/943664 to your computer and use it in GitHub Desktop.
Save alexkolson/943664 to your computer and use it in GitHub Desktop.
Placing the send button on any page using KRL
rule append_send_button {
select when pageview ".*"
{
emit <|
$KOBJ("body").append('<fb:send href="exampley.com" font="Arial"></fb:send>'); // href is the link to send. Can be any valid url. Maybe even location.host? ;)
var head = $KOBJ("head").get(0); // or just document.getElementsByTagName("head")[0], but I <3 jQuery
var script = document.createElement("script");
script.src = "http://connect.facebook.net/en_US/all.js#xfbml=1";
head.appendChild(script);
|>;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment