Skip to content

Instantly share code, notes, and snippets.

@iirelu
Created October 19, 2014 12:58
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 iirelu/cbee5447e97830e39d3a to your computer and use it in GitHub Desktop.
Save iirelu/cbee5447e97830e39d3a to your computer and use it in GitHub Desktop.
Bookmarklet to make a Weasyl submission use an AJAX favourite button
javascript:(function() {
var form = $("[name=favorite]");
form.click(function(e) {
e.preventDefault();
$.ajax("/favorite", { type: "POST", data: form.serialize() });
form.children("button").addClass("active").append("d");
});
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment