var data = { ajax_data: 22 };
// 只能 添加 type 字段,无法添加其它内容
var blob = new Blob([JSON.stringify(data)], {type : 'application/json'});
// Content-Type application/json
navigator.sendBeacon('ajax.php', blob);
var fd = new FormData();
fd.append('ajax_data', 22);
navigator.sendBeacon('ajax.php', fd);
var params = new URLSearchParams({ ajax_data: 22 })
navigator.sendBeacon('ajax.php', params);