在ajax中发送多个变量

I have the following ajax request:

var value = $.ajax({
        type: "POST",
        url: "url.php",
        data: { $(someform).serialize(), something: test_number },
        cache: false,
        async: true
    }).success(function(data){
        alert("success!");
    }).error(function() {
        console.log("FAILED");
    });

But it is logging FAILED although the url is right. What happens is that the page refreshes the page and the php query isn't done. I guess there are no errors within the url... any idea on why this happens?

You are kind of mixing methods to send your POST data. You can't serialize a query strong and then also append additional data to it using javascript object construct. You will likely need to manually append the last data element to the query string like this:

data: $(someform).serialize() + '&something=' + encodeURIComponent(test_number),

Of course there could still be a problem on the server-side script which is causing a non-200 HTTP response code (and triggering error handler). You just need to fix this first, and if you still have a problem, debug the server-side issue.