Trying to capture ble device names and post them to a MySQL database.
Trying to capture ble device names and post them to a MySQL database. Not sure why the post function is not working? Not sure why the post function is not working?
navigator.bluetooth.addEventListener('advertisementreceived',
event => {
var dev = event.device.name;
list.innerHTML=dev;
info.innerHTML=dev;
info.dispatchEvent(clickEvent);
$.ajax({
url : "ajax_post.php",
type: "POST",
data : formData,
success: function(data, textStatus, jqXHR)
{
},
error: function (jqXHR, textStatus, errorThrown)
{
}
});
var formData = $("#myform").serializeArray();
var URL = $("#myform").attr("action");
$.post(URL,
formData,
function(data, textStatus, jqXHR)
{
}).fail(function(jqXHR, textStatus, errorThrown)
{
});
log(i++);
});