ajax in prestashop

$('#id_state').change( function() {
       $(this).find(":selected").each(function () {                            
            city = $(this).text();       
        });

        $.ajax({
            type: 'GET',
            headers: { "cache-control": "no-cache" },
            url: '/index.php?controller=address&ajax=true',
            async: true,
            cache: false,
            dataType: 'json',
            data: {
                city: city,
            },                 
            success: function(jsonData)
            {
                console.log(jsonData);
            }
        });
    });

Comments

Popular Posts