Подскажите, из-за чего не работает javascript?
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
$(function() {
$('#histogram').click(function(event) {
event.preventDefault();
$.ajax({
url: 'action.php?plot=histogram',
dataType: 'json',
type: 'GET'
})
.done(function(response) {
alert("check!");
console.log("success");
})
.fail(function() {
console.log("error");
})
.always(function() {
console.log("complete");
});
});
});
</script>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div class="root">
<form action="newresults.php" id="form" method="post">
<input type="submit" name="histogram" value="histogram" />
</form>
</div>
</body>
</html>
В action.php передается JSON, вроде все как надо...