In Safari only, why is the $_POST
array empty when posting using a jQuery AJAX call?
IE, Firefox and Chrome all output correctly.
<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.1.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(
function()
{
$.ajax(
{
type: "POST",
url: "target.php",
dataType: "xml",
data: ({
'param1': 'param1'
}),
success: function()
{
}
});
});
</script>
<title></title>
</head>
<body>
</body>
</html>
The file target.php
contains the following code:
<?php print_r($_POST); ?>
and outputs the following:
Array
(
)