$('#uploaddata').submit(function(e){
e.preventDefault();
var form = new FormData($("#uploaddata")[0]);
$.ajax({
url: albackend,
type:'POST',
data: form,
crossDomain: true,
processData: false,
contentType: false,
success:function(data){
console.log("success");
console.log(data);
$('#fileupload').hide();
$('#videoselect').show();
},
error: function (responseData, textStatus, errorThrown) {
alert(errorThrown);
}
});
});
答案 0 :(得分:0)
您可以执行与以下类似的操作:
struct ThreadArgs
{
int type;
//others
};
void* Thread(void* thread_args)
{
int type;
pthread_detach(pthread_self());
type = ((struct ThreadArgs *) thread_args)->type;
return NULL;
}
int main()
{
pthread_t thread_id;
struct ThreadArgs* thread_args;
thread_args = (struct ThreadArgs *) malloc(sizeof(struct ThreadArgs));
if (thread_args == NULL)
PanicWithError("malloc() failed");
thread_args->type = 1;
if (pthread_create(&thread_id, NULL, Thread, (void *) thread_args) != 0)
PanicWithError("pthread_create() failed");
while (1)
{}
return 0;
}