Ajax未加载内容

I have a button for increasing the quantity

<input name="quantity-"'.$item_id.'" " id="quantity-'.$item_id.' " type="text" value="' . $quantity . '" />

$increase = '1';

<input name="increase-' . $item_id . '" id="increase-' . $item_id . '" type="button" value="+" onClick="cart_change_quantity('.$item_id .','.$quantity.','.$increase.')" />

the function:

function cart_change_quantity( item_id, quantity, mod ) {
$.ajax({
    url: 'functions/product-change-quantity.php',
    type: 'GET',
    data: {
        item_id:            item_id,
        quantity:           quantity, 
        mod:                mod
    },
    success: function(response) {
        if ( response.search('success') != -1 ) {
            var felbontva = response.split('__'), 
                new_quantity = felbontva[1];

            $('#quantity-' + item_id).val( new_quantity );
        }

        else {
            alert( 'An error occured while trying to update your order.' );
        }
    }
});

}

and the product-change-quantity.php:

$item_id = $_GET["item_id"];
$quantity = $_GET["quantity"];
$mod= $_GET["mod"];

    if ( $mod == '1' ) { $new_quantity = (int)$quantity + 1; }


    echo 'success__' . $new_quantity;

it's just not doing anything. I would like to increase the quantity of a product with that button and later i would like to do more things in the background without refreshing the page so that's why i choosed ajax Thank you!

Based on the source codes you posted above, you're accessing an input element which is not in your html file. If you can notice that in HTML, you have added space after the item id for the input element's ID. While on your javascript, you didn't add space after item id when you are trying to access the same element although I think it is better if you don't put spaces in your ID.

[HTML]

<input name="quantity-"'.$item_id.'" " id="quantity-'.$item_id.' " type="text" value="' . $quantity . '" />

[Javascript]

$('#quantity-' + item_id).val( new_quantity );