Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.fn.beer = function(settings) {
- settings = $.extend({ url: "/", container: "#id-of-container" });
- return this.change(function() {
- var val = $(this).val();
- $.post(settings.url, val, function(response) {
- $(settings.container).html(response);
- });
- });
- }
- $(document).ready(function() {
- $('#id-of-input').beer({ url: '/url/to/post/to' });
- })
Add Comment
Please, Sign In to add comment