Skip to content Skip to sidebar Skip to footer

AJAX Call To PHP File: Return Value Is Empty

I have a simple ajax call: function init() { $.ajax({ url: './myFolder/user.php', data: { action: 'init' }, type: 'post', su

Solution 1:

On user.php page you need to do :-

function init() {
        $arr = array(
            array(
                "region" => "valore",
                "price" => "valore2"
            ),
            array(
                "region" => "valore",
                "price" => "valore2"
            ),
            array(
                "region" => "valore",
                "price" => "valore2"
            )
        );

        echo  json_encode($arr);
    }

Solution 2:

u should have in your user.php somthing like this:

die(init());

Post a Comment for "AJAX Call To PHP File: Return Value Is Empty"