Created
April 10, 2011 16:27
-
-
Save lexer/912489 to your computer and use it in GitHub Desktop.
Action link sample
This file contains hidden or 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
form#form1(action='/form', method='post') | |
input(type="text",name="user[name]") | |
input(type="text",name="user[email]") | |
input(type='submit', value='Submit') | |
script(type='text/javascript') | |
$(function() { | |
$('#form1').submit(function(e){ | |
$(this).invoke().success(function(data){ | |
}); | |
e.preventDefault() | |
}); | |
}); |
This file contains hidden or 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
a#link1(href='/actionlink', data-method='post', data-type='json') foo | |
script(type='text/javascript') | |
$(function() { | |
$('#link1').click(function(e){ | |
$(this).invoke().success(function(data){ | |
}); | |
e.preventDefault() | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment