Created
November 16, 2017 15:53
-
-
Save kimyongyeon/195513bc32fdd8bef7234d359d06d143 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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