daily pastebin goal
40%
SHARE
TWEET

Untitled

a guest Aug 18th, 2018 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top