I need help.
I have this piece of javascript code:
// Upload image to sever
document.getElementById("upload").addEventListener("click", function(){
var dataUrl = canvas.toDataURL("image/jpeg", 0.85);
$("#uploading").show();
$.ajax({
type: "POST",
url: "html5-webcam-save.php",
data: {
imgBase64: dataUrl,
user: "example",
userid: " USERNAME "
}
}).done(function(msg) {
console.log("saved");
$("#uploading").hide();
$("#uploaded").show();
});
});
}, false);
Within "USERNAME" I need to insert a variable to call the username of the user who is sending the photo.
What is the correct syntax? Thank You