Advertisement
Guest User

Untitled

a guest
Oct 25th, 2010
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.78 KB | None | 0 0
  1. <?php
  2.  
  3. if ($_POST) {
  4.  
  5.     var_dump($_POST);
  6.    
  7.     die();
  8. }
  9.  
  10. ?>
  11. <html>
  12.  <head>
  13.   <title>AJAX test</title>
  14.   <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
  15.   <script>
  16.     $(document).ready(function(){
  17.         var jsonData = {
  18.             address: 'address',
  19.             address1: 'address1',
  20.             address2: 'address2'
  21.         };
  22.        
  23.         $.ajax({
  24.             type: "POST",
  25.             //contentType: "application/json; charset=utf-8",
  26.             url: window.location.href,
  27.             data: jsonData, //or whatever name
  28.             dataType: "html",
  29.             success: function (response) {
  30.                 alert(response);
  31.             }
  32.         });
  33.     });
  34.   </script>
  35.  </head>
  36.  <body>
  37.  </body>
  38. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement