jquery ajax send array
ส่ง ajax แบบ array
info = [];
info[0] = 'hi';
info[1] = 'hello';
$.ajax({
type: "POST",
data: {info:info},
url: "index.php",
success: function(msg){
$('.answer').html(msg);
}
});
credit : http://api.jquery.com/jquery.each/วนค่า array มาดู
$.each( obj, function( key, value ) {
alert( key + ": " + value );
});
credit : http://api.jquery.com/jquery.each/