Skip to content

Instantly share code, notes, and snippets.

  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
AJAX helper for categorising credit card transactions, from my personal finance mini-hackathon
var setCategory = function(transactionId, categoryId) {
type: "GET",
url: "/transaction/",
data: {
transactionId: transactionId,
categoryId: categoryId
}).done(function( msg ) {
$(function() {
$("select").change(function() {
var transactionId = $(this).data('value');
var categoryId = $(this).val();
if(categoryId == -1) return;
setCategory(transactionId, categoryId);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment