Guest User

Untitled

a guest
Aug 18th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. return null in ajax [closed]
  2. <script type="text/javascript">
  3. $(document).ready(function() {
  4.  
  5. function doAjax(url) {
  6. $("#customForm").submit(function() {
  7. var formdata = $("#customForm").serializeArray();
  8. $.ajax({
  9. url: url,
  10. type: "post",
  11. dataType: "json",
  12. data: formdata,
  13. success: function(data) {
  14. switch (data.livre) {
  15.  
  16. case 'tituloLivre':
  17. $("#msgbox2").fadeTo(200, 0.1, function() {
  18. $(this).html('error').fadeTo(900, 1);
  19. });
  20. break;
  21.  
  22. default:
  23. $("#msgbox2").fadeTo(200, 0.1, function() {
  24. $(this).html('success!').fadeTo(900, 1, function() {
  25. $('#conteudo').load('test.php'); // show NULL and must be programmer
  26. });
  27. });
  28. break;
  29. }
  30. }
  31. });
  32. return false;
  33. });
  34. }
  35. doAjax('sent.php');
  36. doAjax('dojo/test.php');
  37. });
  38. </script>
  39.  
  40. <?php
  41. include ('includesMy.php');
  42. $form = $_POST['item'];
  43. $oferta = $form['oferta'];
  44.  
  45. var_dump($oferta);
  46.  
  47. ?>
  48.  
  49. item[oferta] programmer
Add Comment
Please, Sign In to add comment