I want to send a Javascript array to PHP using AJAX. This seems very simple code, but I am getting the “No isset” message.
<?php
if (isset($_REQUEST['activitiesArray'])) {
echo 'YES isset';
}else{
echo 'No isset';
}
?>
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript">
var activities = ["thing1", "thing2", "thing3"];
$.ajax({
type: "POST",
url: "JavatoDBase.php",
data: { activitiesArray : activities },
success: function() {
$("#lengthQuestion").fadeOut('slow');
}
});
Safari displays the following, which suggests the POST is operating

If you make an ajax request, you should return something that you can use in the js to determine how it went. You also only want to load the response, not the entire page html and all.
Try this: