Can someone please assist me? I am having trouble sending data via ajax post to my nodejs server from contextmenus. It is not functioning as expected.
Although the ajax request does not give any error alert, the data is not being sent successfully.
I have tried reading the Chrome extension development page, but I am unable to comprehend it fully.
chrome.contextMenus.create({
title: "Report a Scam Image",
contexts:["image"],
onclick: function(info) {
var getUrl = info.srcUrl;
alert(getUrl);
$.ajax({
url: "http://localhost:8023/report",
type: "POST",
data: {
link: getUrl,
}
}).done(function(data) {
alert(data);
})
.fail(function() {
alert("Error!!!!!!!");
});
}
});
The nodejs backend appears to be in working order. It seems like there may be an issue specifically with this section of code.