Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ($_POST) {
- var_dump($_POST);
- die();
- }
- ?>
- <html>
- <head>
- <title>AJAX test</title>
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
- <script>
- $(document).ready(function(){
- var jsonData = {
- address: 'address',
- address1: 'address1',
- address2: 'address2'
- };
- $.ajax({
- type: "POST",
- //contentType: "application/json; charset=utf-8",
- url: window.location.href,
- data: jsonData, //or whatever name
- dataType: "html",
- success: function (response) {
- alert(response);
- }
- });
- });
- </script>
- </head>
- <body>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement