<!DOCTYPE HTML>
<html>
</head>
<body>
<div id="answerPlace"></div>
</body>
<script type="text/javascript" src ="js/jquery-1.11.2.min.js"></script>
<script type="text/javascript">
var myArray = [2, 23, 54, 79, 27, 99, 14];
var url = 'http://page-izbranni.php';
var answer;
$(document).ready(function()
{
$.ajax
({
url: url,
data:
{
checks: JSON.stringify(myArray)
},
success: function(response)
{
$('#answerPlace').children().remove();
$('#answerPlace').append(response);
},
error: function(error)
{
console.log('Ошибка');
console.log(error);
}
});
});
</script>
</html>
if(isset($_REQUEST['checks']))
{
echo "<pre>";
print_r(json_decode($_REQUEST['checks']));
echo "</pre>";
}
var myArray = [];
$(".izbran").click(function(i) {
if($(".izbran").closest(".container")){
$(this).addClass("ura");
var elems = $(this).closest(".container").clone();
elems.each(function (i){
var number = $(this).children("span").text();
//var zif = Number(number);
//myArray[i]= zif ;
myArray.push(Number(number));
});
console.log(myArray);
}
return false;
});
$(document).bind( 'mousewheel', function (e) {
var nt = $(document.body).scrollTop()-(e.deltaY*e.deltaFactor*100);
e.preventDefault();
e.stopPropagation();
$(document.body).stop().animate( {
scrollTop : nt
} , 500 , 'easeInOutCubic' );
} )