How to receive an array after ajax in a php file

0

I would like to send an array after a success return from ajax to a php file

Event:

$('#btn-boleto').on('click', function(){
$.ajax({
    url:'/controlegeracao/gerarboleto',
    type: 'POST',
    dataType: 'json',
    data: {
        id: $('#id').val();
    },
    success: function(resultado) { 

    var dados = new Array();
            dados["id"] = resultado[0].id;
            dados["numero_boleto"] = resultado[0].numero_boleto;

            console.log(dados);

            window.open('../componentes/openboleto/samples/banco_do_brasil.php?dados='+ dados);

    }                   
})})

After the ajax success, it returns these two data, like this, I would like to create an array and send one or more data to PHP, how do I?     

asked by anonymous 09.05.2018 / 20:13

0 answers