98
<form action="/do/stuff.php" method="post"> <input type="hidden" name="user_id" value="123" /> <button>Go to user 123</button> </form>
button { border: 0; padding: 0; display: inline; background: none; text-decoration: underline; color: blue; } button:hover { cursor: pointer; }
86
$('a').click(function(e) { var $this = $(this); e.preventDefault(); $.post('url', {'user': 'something', 'foo': 'bar'}, function() { window.location = $this.attr('href'); }); });
<form action="url" method="post"> <input type="hidden" name="user" value="something" /> <a href="#">CLick</a> </form> <script> $('a').click(function(e) { e.preventDefault(); $(this).parents('form').submit(); }); </script>
72
<form action="./index.php" id="homePage" method="post" style="display: none;"> <input type="hidden" name="action" value="homePage" /> </form> <a href="javascript:;" onclick="javascript: document.getElementById('homePage').submit()">Home</a>