<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script type="text/javascript" src="jquery.redirect.js"></script>
</head>
<body>
<button type="button" name="button">TEST</button>
<script type="text/javascript">
//Log instead of redirect for testing purposes
jQuery(function($) {
$("button").click(function() {
$.redirect("http://localhost/ajaxsubmit/test.php",
[{
user: "johnDoe",
password: "12345",
submit: "name",
phones: [
{ area: "11", number: "4444444" },
{ area: "22", number: "5555555" }
]
},
{
user: "gastonJones",
password: "5431",
submit: "Gastón Jones",
phones: [
{ area: "11", number: "41321" }
]
}],
"POST", null, null, true);
});
});
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<?php
echo "<pre>";
var_export($_POST);
?>
</body>
</html>