Convert GET to POST with jQuery
A bit of code to convert GET values obtained from a clicked link in to a POST and send it as a post using jQuery.
1 2 3 4 5 6 7 8 9 10 |
$('.cssclass').click(function() { var postvar = $(this).attr("href").split('?'); $.post(postvar[0], postvar[1], function(i) { // Look after (i) or do magic. }); return false; }); |
If you generate href values in your code...