Hey I am new to javascript (asynchonous calls).
I would like to call the admin-ajax.php file which contains a function that needs an image/blob to insert in the DB.
So this is the ajax call I made:
jQuery.ajax({
url:"//domain.com/wp-admin/admin-ajax.php", //the page containing php script
type: "POST",
data: {action: "addimagetocart", image: blob},
success:function(result){
console.log(result);
}
});
In the above code, the blob
variable contains a blob (created by html2canvas) which could be saved as a .png
file.
My questions: