Posted By

jamesming on 07/28/09


Tagged

post


Versions (?)

Who likes this?

11 people have marked this snippet as a favorite

jillella
vali29
nreliu
frontend_P
esritter
xmartyxcorex
etangle
qrczak
wirenaught
ringo380
Some0ne


Simple JQUERY AJAX POST


 / Published in: jQuery
 

  1. <script type="text/javascript">
  2. $(document).ready(function(){
  3. $("form#formId").submit(function() {
  4. inputField = $('#inputFieldId').attr('value');
  5. $.ajax({
  6. type: "POST",
  7. url: "yourpage.php",
  8. cache: false,
  9. data: "inputField ="+ inputField,
  10. success: function(html){
  11. $("#ajax-results").html(html);
  12. }
  13. });
  14. return false;
  15. });
  16. });
  17. </script>

Report this snippet  

You need to login to post a comment.