Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aleksb86/7e185fef8d48b6b3fe16a8a73c0b67f6 to your computer and use it in GitHub Desktop.
Save aleksb86/7e185fef8d48b6b3fe16a8a73c0b67f6 to your computer and use it in GitHub Desktop.
# Simple GET:
$("body")
.on "change", "select#portfolio-select-year", () ->
selected_year = $("select#portfolio-select-year :selected").text()
url = "/fixes?selected_year=#{selected_year}"
$.get(url)
# GET with callback:
$("body")
.on "change", "select#portfolio-select-year", () ->
selected_year = $("select#portfolio-select-year :selected").text()
url = "/fixes?selected_year=#{selected_year}"
$.get(url), (data) ->
$("#some-element").html(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment