Skip to content

Instantly share code, notes, and snippets.

@kimyongyeon
Created November 16, 2017 15:53
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 kimyongyeon/884ef47d1aa328422602677e7273c99b to your computer and use it in GitHub Desktop.
Save kimyongyeon/884ef47d1aa328422602677e7273c99b to your computer and use it in GitHub Desktop.
<script type=text/javascript>
$(function() {
$('a#calculate').bind('click', function() {
$.getJSON($SCRIPT_ROOT + '/_add_numbers', {
a: $('input[name="a"]').val(),
b: $('input[name="b"]').val()
}, function(data) {
$("#result").text(data.result);
});
return false;
});
});
</script>
<h1>jQuery Example</h1>
<p><input type=text size=5 name=a> +
<input type=text size=5 name=b> =
<span id=result>?</span>
<p><a href=# id=calculate>calculate server side</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment